Changed all the information pertaining to contracts to use mongo

The contract is now driven from Mongo. All information pertaining to a
contract is written to the contract document. Still need to complete
adding port groups to the mongo collection. The Port group is added,
but the Id is not correctly passed back, needs to be tested.