Fix issue 113 ('application/json' content type returned even when it's not specified in Accept header)

Here's my proposed fix and additional tests for issue #113.