Add composer diag command to diagnose problems automatically
Add docs for diag command
Rename diag to diagnose, fix feedback
Merge branch 'diag'
Add a couple version parser tests
Fix dependency flags not applying to provides/replaces, fixes #1771