Was Lincoln opposed to slavery? Absolutely. Did he free the slaves? Yes. Was he in favor of racial equality? Absolutely not. He made that point clear repeatedly, especially during his famous debates with Stephen Douglas. If he had lived to lead the nation through Reconstruction perhaps he would have softened these views but we can never know that now.
As for his principles, he was like any politician and most successful leaders: willing to bend them when he had a greater goal in sight. The new Spielberg film "Lincoln" illustrates this very well.
Was he ahead of his time? No. Millions of people in his era and before him opposed slavery. If they had not, the nation would not have been divided. However, he was an extraordinary leader, the right man at the right moment of history. And for that, we salute him.