Move temporary database creation code into a class.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>