Reduce code duplication in parse functions
Get rid of magic numbers in display function
Assertify
Avoid hitting the cosm rate limit

The current implementation of ncrzlstat pulled data from cosm every time a key
was pressed or the window was resized. It was not unusual to hit cosms rate
limit after three minutes.

This commit changes the implementation in a way, that only after a given refresh
timeout the data is pulled. The display will still be repainted after every
keypress or SIGWINCH received. This is far from perfect, but it is good enough
at the moment.

Currently, I am working on a non-blocking display, that only repaints itself if
new data was pulled or a SIGWINCH was received.
Rename display.[ch] to ui.[ch]
Remove "event loop"

In order to rework the inner workings of the "pull data - parse json - display
ui" workflow, remove the current "event loop" and start from scratch.

With this change a single snapshot of the state is displayed.
Rewrite "event loop" from scratch

* Wait for timeout before pulling data
* Redraw the screen only if new data has been pulled or the terminal has been
  resized

The code is a little hacky in the way it reparses already parsed data.

CAVEAT: The redrawing of the ui after terminal size changes is implemented but
not working yet. For some reason ncurses default SIGWINCH handler is not
triggered and KEY_RESIZE is not returned by getch().
Workaround issue in older ncurses implementations

A bug in GNU ncurses 5.7, and probably other versions, prevents ncurses default
SIGWINCH handler from being triggered. You can work around this issue by calling
doupdate() just before the call to getch(). At least with the latest version of
GNU ncurses 5.9 this issue seems to be fixed.

So, if the ui is not updated after resizing the terminal, try to build with
OLDCURSES defined.

This is the default, if you are using the BSDmakefile to build ncrzlstat.
Avoid direct manipulation of model in ncrzlstat.c
Use "protected" names in prototypes
Add some documentation
Merge branch 'master' of git://github.com/blabber/ncrzlstat