Implicitly create composer.json in require command

This allows shorteninig install instructions if you do not want to use init
(because it is interactive) and you do not want to use create-project (there
is no skeleton, or you do not want to use a skeleton).
Add newline because JsonManipulator does not expand {}
Merge pull request #1480 from igorw/create-config-on-require

Implicitly create composer.json in require command
Fix parsing of ~ version constraint with unstable versions, fixes #1476
Expand {} into a new line before manipulating json, fixes #1481