Refactor DB() into its own file and test error handling via Promise and Callback APIs.