Added some missing references to global db
Changed to scripts to use environment variables instead of direct connection strings