The very, very oversimplified version of the slavery issue is this:
The Democrats, in the relevant part of the 1800s and continuing through the early part of the 20th century, were largely a party of the South, though this was not their only base of power and they were not always the dominant party there. The Republicans largely represented Northern business interests, though again this was not their only base of power and they were not always the dominant party there.
Political parties have always been primarily about representing economic interests more than about any particular ideology, but until the 20th century they tended to be very open about this fact. Representing the economic issues of the rural, plantation-dominated South (specifically, Southern business interests and the jobs that relied on them) often meant supporting slavery. Representing the economic issues of the industrial North permitted (though it did not require) opposing slavery.
Lincoln, a Republican, was President during the Civil War. Because of the war, abolishing slavery made not only economic but military sense for the Union. While black soldiers did fight on both sides, there was an expectation, which was realized at least in part, that when news of the Emancipation Proclamation reached Southern slaves they might be encouraged to come north and fight for the power that had freed them. There was some hope that Northern businesses might benefit economically as well, due to some complex economic factors in play at the time.
So everything worked out, more or less - the Union won the war, the slaves were freed. But because of the way in which it happened - led by a Republican President, the Union had effectively subdued the South and abolished the foundation of a big part of its economy - the Republican Party became even less powerful in the South than it had been before. The Democrats dominated Southern politics for most of a century.
As you might be aware, that's not at all how the geography looks today. Today, Democrats dominate Northern and urban areas while Republicans are strongest in Southern and rural areas - the exact opposite of the situation I describe above. That's because of a switch that happened in the mid-20th century. Republicans had begun to make gradual advances in the South in the 1940s and '50s, but these were slow and failed to match the gains Democrats had made in Northern working-class communities during President Franklin D. Roosevelt's time in office.
The Civil Rights Act of 1964 changed that. President Kennedy, a Democrat, supported the bill which would guarantee civil rights to black Americans and other racial minorities. (How this came to be, in the party that only a few years earlier had still officially supported segregation and other civil rights atrocities, is complicated). While Kennedy was alive, the bill went largely nowhere; 21 Southern Democrats in the Senate would not vote for it under any circumstances, and under Kennedy's leadership not enough Republican support could be found to pass the bill. When Kennedy was assassinated and his Vice President Lyndon Johnson became President, that changed. Johnson was able to work with Republicans to find enough votes to pass the bill.
The passage of the Civil Rights Act was historic, but it had major political repercussions. Much as Republicans lost most of their Southern support after the Civil War, Democrats lost much of their Southern support after the Civil Rights Act. Republicans were able to take advantage of this; Richard Nixon's famous Southern Strategy
http://en.wikipedia.org/wiki/Southern_strategy enabled the party to make major gains in the region at the cost of some of their historical reputation for being relatively liberal and anti-racist. The Democrats, on the other hand, picked up overwhelming support from black voters throughout the country (support that continues today at levels of 80% and higher, unrivaled by any other constituency in their near-unanimity). They also picked up support from Northern liberals and middle-class voters, solidifying their grasp on New England and the Upper Midwest where they already had strong support from working-class voters thanks to Roosevelt's New Deal. And supporting other civil rights advances that happened around the same time netted them support from women and other minorities and solidified their support among academics and upper-middle-class liberals.
The end result is that the Democrats today generally support social policies that are liberal; their platform is crafted to please their core constituencies, Northern, blue-collar, educated, minority, female, secular, and urban voters, and so generally supports racial equality, GLBT rights (gays and trans people cluster in urban areas and are a noticeable constituency for Dems), women's rights, public education, public transportation, and separation of church and state.
The Republicans today generally support social policies that are conservative; their platform is crafted to please their core constituencies, Southern, wealthy, white, religious, male, less-educated, and rural voters, and so generally supports a number of things that I'm not sure how to phrase positively. They do almost universally oppose GLBT equality.
The economics are a bit more complicated because neither party has fully divorced itself from its economic roots; the Republican Party still does tend to support Northern big business and industry, although that industry has now spread all over the country and the planet, and the Dems still do tend to support agricultural businesses and farms, although again that's now much less regional and Dems have taken up support for industry as well (making the parties basically unanimous in their support of multinational corporations). If economics are important to you, you'll need to do more research.