Make main.cc a bit cleaner and start using C++11