Added overloaded operators for PluginState.
Improved pyflakes test.
Fixed bugs found by PyFlakes.