Added event handling and primitive main menu system.