Env config

@gesellix, @marcuslinke,  here is the work for configuring via ENV. You only need to look at the last two commits.