Database handler boilerplate and tests