Also use the json module to generate the environemnt dictionary string. This takes care of a None objectId cleanly.
We are not setting up a single sugar.window.environment object.