Added a Global object, some cleanup.