Refactored the terminal initialization code. Also, we will now properly shut down...