frontend: Added basic support for semantic AST analysis.

For now, the analyzer checks the types of all matcher operands.
store: Merged sdb_store_iterate() into sdb_store_scan().

These functions are really the same when using a NULL matcher and filter.
store: Let sdb_store_scan() support other object types besides hosts.
store: Use sdb_avltree_lookup() to retrieve attributes.

… rather than iterating through all attributes. D'oh!
store: Let sdb_store_scan() pass on filters to callback functions.

The callback function needs access to the filter anyway, so let's handle this
centrally.
sysdbql(7): Link to the JSON RFC.
store_lookup_test: Ensure that filters are applied before matchers.
store: Provide more verbose messages on errors during scanning.
store: Added a generic JSON formatter.

It works by consuming single objects of any type (host, service, metric,
attribute) at a time and appending their JSON serialization to a string
buffer. The current position in the object tree is recorded in an internal
state.

A helper function is provided on top of the base formatter which allows to
handle an full object at a time.
frontend/query: Use the new JSON formatter to implement LOOKUP.

This will allow for more flexiblity.
store: Record each object's parent.
t/: Added tests for json_formatter-based JSON generation.
store: Let the JSON formatter know about arrays at top level.

There's no reason to require this to be handled separately.
store: Let JSON formatter know about the to-be-formatted object type.

When formatting services or metrics, expect those objects to be emitted on the
highest level and then create the host object for them first (once for a
series of objects belonging to the same host).
frontend: Let FETCH apply filters to the host as well.
frontend: Let FETCH and LIST use JSON formatters.

… instead of the old tojson functions.
store: Removed now unused tojson functions.
store: Added sdb_store_get_child().

This function may be used to retrieve a host's child object (service, metric,
attribute) by it's name.
frontend: Let the 'fetch' command support other types besides hosts.
frontend: Fixed various size checks.