added support for 'main' class

Added support for main classes. Specified in the config, the main class
is instantiated once it's loaded.