refactoring mercilessly: Q promise API for DB connections