Disable page state checking for now.
Use the simple Mercurial source-control temporarily.

The command-server implementation is faster in an environment that only has one
process (such as a Python interpreter), but leaks command-server processes in a
multi-process environment (such as Apache mod_wsgi).

Also moved the factory building code to separate functions.
Merged changes.