Move ENV variable checks to core, and pass a config hash to the db