Modifications required by yeoman generator-loopback

All changes preserve backwards compatibility of the API.

The behaviour is mostly backwards compatible with the following exceptions:
 - Order of properties written by Project.writeToFiles to models.json is changed to match the order templates.
 - Datasource name must be unique now. Before this patch, a new record with the same name would silently overwrite the old record. 

/to @ritch please review