Namespaced custom events (fix for #333)

If you read the commits it's a little strange. Learned lessons here on how to do multiple pull requests for the one repo during all of this. I first pushed my fix for this into the same branch which had a pull request for a different issue. Created another branch for this and manually undid my changes for the other issue, then made the correct ones here