Add improved key input function

And cursor highlighting
Add new cellwise drawing logic
Misc fixes

Capitalization and close the reading stream