Input Threading

This isn't yet hooked up in main, but a simple input thread mechanism
has been added.