Do some stuff that cannot be described in one line.

 1. Make `post_create` return the ID of a thread instead the ID of a post.
 2. Merge `json.dg` and `html.dg`, moving json-generating and image-saving
    functions into `tools.dg`. Instead of including the JSON API as a blueprint,
    return JSON from the normal URLs if a client specifies the appropriate
    MIME type in the Accept header.
 3. Make all `url_for` calls relative to the current blueprint.
 4. Rename `uploads` to `upload` and `thread_redirect` to `thread`.
 5. Merge `thread_create` and `thread_reply` into a single function `post_create`.
 6. Don't suppress imagemagick errors. The post is already created anyway,
    but at least the user will know something's wrong (though that
    "something" probably means "imagemagick's not installed".)