Fixed errors in models, updated database configuration to use environment variable, and moved scripts to a Makefile