Added very brief test for JSON output.

Note that this only tests one call, so it can't be considered
any sort of comprehensive test - we will need to add more.
Report output mime type from `output_formatter`.

This means we can report the correct type in the HTTP response
header. Note that, at the moment, it's hard-coded to add a UTF-8
charset specifier. This might need to go away in the future, but
is fine shared between JSON and XML, both of which are UTF-8
anyway.
Added missing `id` attribute for JSON elements.

This fixes issue #61. The JSON test passes now.