Werkzeug support

This PR gives initial Werkzeug support. This brings much-improved HTTP handling and an initial  pass at CORS support.

This is currently deployed using the CLI server application as before, but uses the Werkzeug development server. Testing is required to determine how well this interacts with apache, nginx etc.