More refactoring, added GuiHandler, created basic structure of first machine