Added syncing of history (all items present - fixed #8), use of history
library (fixed #10), correct cursor rendering @ prompt (fixed #2) and
selection area rendering (fixed #1).