Move repository to lib/db.js

Relative paths for "library" type modules