Plugin changes

Johan...
Here are the changes I made to the plugin - it's a lot of text, but very little functionality...
The commits should be pretty self-explaining, but let me know if something's not clear or you don't like it...

Pavel