Minor changes to TestCard. Moved DB calls to new file.