Major improvements. Fix tests again
Improve plugin.py tests