Merge pull request #40 from veeti/leak

Fix leaks in data save and load
Add a basic visual friend list
Delete friend list window at exit
Rewrite input history navigation

- Use an offset from the bottom for storing the navigation state

- Rename the navigation functions to upHistory and downHistory for less
  confusion

- Centralize repeating buffer refresh code

GitHub: fixes #22