(PDB-452) Adding support for storing environments

Added support for environments to the model and command wire formats.