first pass at multi environment support

I've run through all the commands in a dummy repository and everything seems to be ok, there are no changes to any tests with this so it should not be merged as is, I just wanted to open this for an initial pass thru by other eyes.