Ported changes to user script version.
Merge pull request #18 from MattiasBuelens/port-userscript

Ported changes to user script version. Fixes #16.