Env refactor

Please do give this a careful once-over.  I'm a little concerned that changing the Content-type of notification posts from 'text/plain' to 'application/json' might have unintended consequences. I did it because the new lobby pays attention and won't parse a JSON body if the Content-type isn't correct.