Made the controller customizable.

This enables the end user to install their own handlers for keyboard and
mouse input.