Added command history and its browsing. Added text trimming when it exceeds max length