Refactor and add tests for plugins.py

Improvement to the tests currently being run on ``plugins.py``
I am not sure what the bug is. I thought https://github.com/Freeseer/freeseer/pull/589/files had discovered the bug but it appears it has not. I will look through git history to figure out when the comment was put it.