Refactor and add tests for plugins.py

Improvement to the tests currently being run on ``plugins.py``

related #644 
Try to avoid single/double character variable names like this except for counters or iterators.