Plugin context event with generator.

@jrbasso As discussed, this is a way for the plugin manager to trigger events in the context of registered plugins within plugins themselves.

I've also added a dev dependency for PHPUnit 4 and updated travis to use this dev dependency.