state: extracted environment setup ops

The code to generated DB operations for setting up the initial
environment have been extracted so that they can also be called from
elsewhere.
state: NewEnvironment now provides an initialized environment

NewEnvironment used to just add an entry to the environments
collection. Now all required initialisation is performed so that the
returned environment is ready to use. This has required a signficant
change to the the method's signature.
state: use jc.IsNil throughout EnvironSuite
Merge pull request #1178 from mjs/newenvironment-refactoring

reworked State.NewEnvironment()

state: NewEnvironment now provides an initialized environment
    
NewEnvironment used to just add an entry to the environments collection. Now all required initialisation is performed so that the returned environment is ready to use. This has required a signficant change to the the method's signature.

---

state: extracted environment setup ops
    
The code to generated DB operations for setting up the initial environment have been extracted so that they can also be called from elsewhere.


(Review request: http://reviews.vapour.ws/r/489/)