Major refactoring. There is now one class for every main in the program