Lots of little tiny changes and added Message and MessageQueue, a singleton class which manages the dispatch of Messages and can work in multi-threaded programs.