It is too bad that you only read snippets of the Bible instead of reading it completely and understanding it all.
Slavery- Slavery in the Bible is very much different than what was experienced in America. Just because laws and regulations were given in how slaves were to be treated, that doesn't mean they were the same type of slaves as what was experienced in America. Majority of slavery that took place, after the Israelites were freed from Egypt, was considered indentured servitude. People became slaves to pay off debts, sold family members to pay off debts, or were sold to pay for their crimes of thievery. After being held as forced slaves by Egypt, the decision to hold people as slaves in the same way was to never take place, which is why part of the Mosaic Laws were written. There were people who did abuse that, but that doesn't mean it was condoned by God or religion. Something you fail to realize is that "slavery" is a part of most cultures, as with the case of those in the Bible. The Bible doesn't just tell us how we should live our lives, but also a history of what the culture was like of the time.
Rape- Laws were written about what punishment rapist should receive for their crimes to protect the victims. Something else you fail to realize is that the culture practiced not having sex before marriage. For a woman to have sex before marriage was considered to be immoral, and that a man should marry a woman who has never been with another man. So when a woman becomes a rape victim, she is viewed as no longer being acceptable to marry. If a woman is unable to marry, then she would have to take care of herself, which at that time was nearly impossible without becoming a prostitute or a slave. So the punishment that is given to a rapist is that he must take the woman as he would a wife, without being allowed to have her as a wife. This means that he is suppose to give her shelter, food, and protection, but not allowed to have sex with her without her giving permission. The woman does have the option to not take her rapist as a husband, but she then risks never being able to marry or have the benefits that a wife would normally have.
Just because the Bible mentions something and gives laws and punishments for something, just because those same punishments are not the same of what would be today, that doesn't mean the Bible is condoning those acts. You have to realize that the times were different back then, as well as their culture.