Closes issue #7 and code is also now cleaned up a little.

I thought it would be better, if I helped improving the plugin. I hope you don't mind. :smile: