Use $.getJSON data argument to pass query and page

Data is appended as query string and will be url-encoded.
Drop the useless '.json' extension in the URLs.
Fix the URLs in tests.

For the tests to pass again, accept pull request #1.