Factor out basics of the server implementation

This allows other implementations of a server.

Refs #347
Implement DjangoServer

Refs #347
Fixes for integration tests
Add new 'kale' tests for testing the pluggable backend

Taken from code written by Alexey Kotlyarov <alexey@infoxchange.net.au>
Fix for integration tests
Update docstring