Added kbhit, and re-arranged some functions that probably shouldn't
have been in the classes.
Merge origin/master