Mostly re-wrote TConsole class to be more useful.