Added DB class, and tests