Added main loop, basic module gamestate support