Fixed up console history to be retained when the console is closed.
Fixed all severe style violations.