Fixed newline command in textarea terminal

Also deleted a lot of dead code, added some logging