Move main to Classes.
Some fixes.