Controller structure

Bringing in the controller code which allows for capturing keyboard input.