NEW: Rewrite self.version in create-project (Fixes #1351)

When composer create-project is called and the resulting project is disconnected from the
parent repo, self.version references no longer work.  To fix that, this patch rewrites
self.version to the actual version number as part of 'composer create-project' execution
Allow JsonManipulator::addMainKey to update top level keys as well
Merge remote-tracking branch 'sminnee/create-project-self-version'
Refactor self.version update to work on all link types, refs #1883
Fix JsonManipulator handling of package links, fixes #1465
Clarify usage of addcslashes
Fix handling of multilines in previous commit
Document a hack