Componentize rendering to application/json.

Models marked with render-inline meta are rendered into the content of
separate IWritableDocument instance and later componsed into the resulting
structure. This allows using custom (per model type) writer which allows
a tremendous optimalization.
Allow registering document writers for specific classes (instead of interface).
Implement custom writer for the result of the db api query.

This improves efficiency of rendering long lists.
Only check update_seq of the database once when performing the query.
Fix failing tests for dns agent.
Merge branch 'refactor-model-writer'