Fix share download

fixes download issue introduced by https://github.com/owncloud/core/pull/10755

This is a fairly large change please test thoroughly as im sure we missed some cases
Settings is basically just an app in a different folder. It should get its own application.php, thats fine :P

Regarding the routes: you can manually dispatch on the application if you dont/cant use the built in routes like:

```php
$this->yourRouteCreationStuff('/route/')->action(function($urlParams) {
    $app = new Application('files_sharing', $urlParams);
    $app->dispatch($controllerName, $methodName);
})
```