Overhaul test setup.

Create failing testcase for the effects of https://github.com/MongoEngine/mongoengine/issues/570
Fallback to `object_class` for queryset lazily.

Avoids errors (caused by accessing a queryset) in cases where a database connection is only setup later in the application.
Tests: use `json.dumps` to create request bodies; more readable than escaped strings