[5.0] Refactor AppNameCommand And AppNamespaceDetectorTrait

* Allow `AppNamespaceDetectorTrait::getAppNamespace()` to specify custom path allowing it to be reusable for other purpose.
* Move app namespace detection and loading of `composer.json` when the command is fired (and not on every artisan request). This would avoid bugs when testing packages such as evident in <https://travis-ci.org/orchestral/testbench/jobs/36551279>
* Hardcode `AppNameCommand::$currentRoot` to "app" path since the whole command rely on hardcoded `$this->laravel['path']`.

Signed-off-by: crynobone <crynobone@gmail.com>
Thanks.