Add more comments, adjust includes and namespaces in main.cc.