Moved some initialization stuff to an Application subclass, did some other stuff.