Add Favorite table
Implement more database helper functions and remove test.js file