HTTP REST API infrastructure - fixes 886

Fixes #886.

Code is still camelCaps, we can fix that later sometime. Some code is still unported, in particular the Sphinx extension; we can do that when we get to writing documentation.
Looks like that Klein PR is merged.  Maybe this code will work if we drop this monkey-patching now.  Try this here or file a follow-up issue.