Factor out DB stuff into model to unclutter routes.js, add gitignore