Added command-loop for TerminalApplication