jsonhttp: new package

This factors out some functionality from the charm store that makes
it easier to write JSON-returning HTTP handlers, without tying
it to a specific representation of error responses.

Also it would be nice if you can return other statuses from your function, many API's might want to return errors with json objects.