Implement key, mouse, joystick, and time.

More modules that don't depend on the graphics system or other libraries.