Fixed a silly problem.

Uses json.JSONEncoder() instead of just json (which would fail).

Added a tiny test to see if it works.

TODO:

There needs to be better test coverage, there is nothing testing startkey and endkey queries besides the little test I put in place now.