tests config update.
Big connectio refactoring.
Massive connection refactoring inspired by MongoEngine.