Add handling of preferred-install config in create-project, fixes #1780
Add COMPOSER_DISCARD_CHANGE env var, refs #1188