Improvements after being pointed to similar solution.

Facebook has a similar solution:
https://godoc.org/github.com/facebookgo/flagenv