Refactor and add tests for plugins.py

Improvement to the tests currently being run on ``plugins.py``

related #644 
Couldn't this be reduced to
```python
elif os.path.isfile(os.path.join(root, plugin_name, '__init__.py')):
```