README: Added libfacter and librrd to list of prerequisites.
store.h: Make it such that HOST/SERVICE/METRIC don't share bits with ATTRIBUTE

An attribute can be assigned to any of the other types. This approach allows
to represent host-, service-, and metric-attributes in one byte.
sysdb: Clear the current command from the buffer after error.
sysdb: Make sure to properly reset term attributes.

Don't record the "old" settings on each call to rawmode since we do that a lot
of times. Also, don't use up all atexit handler slots this way.
sysdb: Don't exit if the server closed the connection.

Instead, notify the user an try to reconnect before executing the next
command.
sysdb: Do an attempt to reconnect on all user input.
sysdb: Parse strings correctly.

… and focus only on syntax elements that may include semicolons and escape
their meaning as a query terminator.
sysdb: Store all commands in the history; even if they failed.
sysdb: Fixed check for duplicate history entries.

current_history() returns the currently *selected* history entry. Rather, we
want the latest entry, that is, the one added last.
sysdb: Only try to reconnect before executing a command or on an empty line.
sysdb: Wait for the actual reply after sending a command.

Otherwise, multiple replies (log messages) will be interleaved with input
prompts.
sysdb: Use sdb_log() instead of printf().