Mainly untested database class.