First prototype of json and json-ld serlization for long-polling.

Long-polling clients that send 'application/json' in the Accept header
receive the JSON-formatted data.
Small changes: fix imports and a function's comment.