Reorganizing java8-nifty-service code a little
Pull environment name from system environment
Backport java8-nifty-service