Refactored and cleaned up testDatabase.js