Optimize the database protocol.

 1. Methods now only return the minimal required value.
 2. IntRef serializes into a single integer instead of a whole dict.
Fix a couple of type signatures.
Import macros with context.

This fixes weird url_for behavior.
Fix a bug in post_create when a tree is 2+ levels deep.
Finish implementing post/thread creation.

Except for file uploads.