Add support for postgresql+gevent and do random little fixes