REIVEW: [NX-518] Orient database manager

This PR addresses the following issues:

https://issues.sonatype.org/browse/NX-518
https://issues.sonatype.org/browse/NX-519
https://issues.sonatype.org/browse/NX-542
sure, I also thought in the future we might have a specific impl of DatabaseManager for testing too.