Deduplicate dependency checks

Some code that I also used for https://github.com/owncloud/administration/pull/11
Alternatively, you might want to use the array keys of the outer array as follows:
```
foreach ($dependency as $booleanFunction => $requirements)
    foreach ($requirements as $requirement => $module)
        if (!$booleanFunction($requirement))
            $missingDependencies[] = $module;
```