Fix ScoringService
Use monotonic time in ScoringService
Move ungreen_psycopg together with other gevent & psycopg utilities
Style fix
Style fixes

Put the call to the superclass constructor as early as possible.
Remove decode/encode_json

Their only user was already doing proper error handling, there was no
need for them.
Make initialize_logging become a method of Service

This seems more natural, avoids a circular import and reduces the
dependencies of cms.log, allowing it to be imported earlier during the
bootstrap (more on this later).
Split cms/__init__.py

It's considered bad practice to put actual code in __init__.py, hence we
move it to appropriate modules and use that file to glue them together.
Move cms/io/__init__.py to cms/util.py

They were of general use and didn't depend on anything else in cms.io.
Improve cms/conf.py

Take advantage of the early availability of logging and use it when
searching for configuration files. Also do a couple of style fixes.
Improve cms/util.py
Reduce duplication of JavaScript files

The ones in cms/io/static were just used as targets of the symlinks in
cms/server/static: we can put the files directly in the latter location.
Move TestService to cmstestsuite

Together with other testing related files.
Redesign cms.io in a gevent-oriented fashion

Some oddities were left from the old tornado days, like our own loop in
Service (just to fire timeouts) and a general callback-centric design.
This commit aims to take full advantage of gevent, rethinking the
architecture in this new light.

Notable changes:
- No loop inside Service: each timeout gets its own greenlet that calls
  the function (catching and logging all unhandled exceptions) and then
  (yields and) waits.
- The RPC calls are handled more "naturally" with an AsyncResult. The
  old callback-powered interface (kept for compatibility) is now built
  on top of it.
- More extensive use of werkzeug to avoid reinventing the wheel and
  provide a single standard HTTP interface.
- Centralized and consistent status management, global and safer error
  handling and more dense and detailed logging.
- Outgoing connections are reused (e.g. don't open two sockets to
  LogService).
- Modules in the package are rearranged (and lowercase named, for PEP8).
- Less clutter, more modularity and extensibility.
Style fixes

Mostly suggested by pylint
Fix a test