Fixed input code to identify keys. Added initial main gameloop.