[#2492] Removing an unused variable and use statement, fixing phpdoc
[#2492] Automatically using the latest version when requiring a package

This applies to the init and require commands.

Previously:

If you ommitted the version of a library, it prompted you to enter a version.

New Behavior:

If you omit the version, it automatically selects the latest version that is consistent
with your minimum-stability flag.

Is Jordi mentions, this is consistent with how npm works.
[#2492] Prefixed real versions with ~ when guessing the latest version

2.1.0 > ~2.1.0
v2.1.0 -> ~2.1.0
dev-master -> dev-master
Extracting logic into a new class related to selecting the latest version

Also refactored InitCommand slightly so that you can use this "latest version"
functionality when searching for a package as well.
Refactoring selection of the "recommended" version (e.g ~1.2) and adding some tests

This also modifies the behavior slightly (from a recommendation by seldaek) to always
propose the minor version of the recommendation (e.g. ~1.2 instead of ~1.2.1).
Merge remote-tracking branch 'weaverryan/require-version-select'
Allow using new code in the init command and avoid initializing the composer instance too early, refs #3096
Tweak rules to allow guessing based on branch aliases and avoid greedy constraints on alpha/beta/RC packages, refs #3096