Script has associated effects

@ertyseidohl this is currently branched off my first PR so will just need to be rebased when all that's fixed. I'll happily fix up the inevitable merge conflicts but thought I'd throw this out here for you to check out. :)
I looked at it briefly, and I think it could be. At the moment I think it works for tightly coupling to the script.