Added a command-based InputHandler class.