Add cache support for getDirectories() method and refactor

* Cache support for getDirectories() added.
* Added memoize() method to avoid code duplication related to cache implementation
* Renamed methods to avoid redundant "module"

Hope you find it useful!
The YamlDiscovery expects an array instead of \ArrayObject in the constructor. I think that this is a kind of inconsistency in D8 core, or they had a good reason for that :)

This is the full error message:
> Recoverable fatal error: Argument 2 passed to Drupal\Core\Plugin\Discovery\YamlDiscovery::__construct() must be of the type array, object given, called in /home/plopesc/projects/Bluespark/bapi/www/sites/all/modules/plug/modules/plug_example/src/FruitPluginManager.php on line 46 and defined in Drupal\Core\Plugin\Discovery\YamlDiscovery->__construct() (line 37 of /home/plopesc/projects/Bluespark/bapi/www/sites/all/modules/plug/src/Core/Plugin/Discovery/YamlDiscovery.php).