What we call employment today is translated as slavery from those ancient texts today. Servants, like employees today, were liable to employers for losses, and were held to contracts, in order to fulfill conditions that they had previously agreed to, for some provsion they had in mind to earn. There were years of release of all from these terms, as far as the servants went, but in the case of the employers, there was a forcing of their forgiveness of all debts being worked for the payment of. If someone does a certain thing today, wages might be taken by the court, or community service imposed.
There in fact is no verse saying one can sell a daughter into sexual slavery. Also, there are statements right in the Text that many of the things in it require further judgement, in the context of each event, by the Elders, whose Oral legal training and Understanding were also intended to be followed as well.
In times of war, those who had invaded them, also, were made to work to pay back costs they inflicted on the people, or were given servitude as a sentence, rather than death for what may have deserved a harsh punishment - such as trying to annihilate their people.
Again, monkeyb.pants, it never says one should hit anyone, but knows that if one does, it will be a matter to deal with. Judges gave more particular sentences out of their training by Moses. It says to treat even foreigners well, and commands to treat brothers as brothers, which, if obeyed, would avoid slavery. But again, slaves weren't what we think of that word today to mean. So even if one is forced into it, I also am forced to work for an exacting master in a situation I don't like either. Why doesn't my employer make me a freed man, giving me the money that would necessitate to get that freedom and keep it?
Also, even a captive of war was given one out of seven days to absolutely rest, and a master could be put to death for even ruining his rest with any kind of demand, any sort of stressful exchange.