Allow plugins to register commands

This PR will move plugins to a next level by exposing the application to the plugins (and also loads the plugins BEFORE the application starts).

It might be a start to solve few tickets like #3312 or https://twitter.com/lsmith/status/526053583834603520
ping @lsmith77

It should also fixes #1234, #2761

Sample of use
```
composer global require FriendsOfPHP/security-advisories
cd my/project
composer security-check
```

Or with the sensiolab's secret project
```
composer global require sensiolabs/secret-project
composer play path/to/a/script.php
```

Want to simply test  it see a sample plugin (https://github.com/jeremy-derusse/composer-plugin)
```
composer global require jderuse/plugin
composer demo:greet
```

Todo
* [x] Add tests
* [x] Refactor the "plugins warmup" thing

`$localConfig` is not null because the variable is replaced at line 203. And given `Application::getComposer` use a singleton pattern, we couldn't create 2 instances of composer (one with a localConfig and another without).

To summarize, here is the problem:
- The application register commands (included the plugin's one https://github.com/composer/composer/pull/3377/files#diff-1ee6b7b9e29f931c3a6814149d9f972fR149)
- To retreive the list of plugins, we need a instance of Composer (https://github.com/composer/composer/pull/3377/files#diff-1ee6b7b9e29f931c3a6814149d9f972fR339)
- The factory check if a localConfig is present and throw an exception.

With the validation in the factory, every commands need to be ran with a local config. That's why I moved the check in the command who need it.