Implement database  connection pooling

Implement connection pooling.
Refactoring in libs/db.js.
Update Vow to 0.4 version
Provide posibility of gracefull web server restart

1. Implement on exit event handler interface in daemon.
2. Update web server to make possible to stop listening
and wait until all active connections will end
3. Refactoring in database library. Split it into
parts, to make possible to override something