Add the possibility to flush events for phpunit testing

After spending some hours, I discovered that it is required to redefine model events after each single test with phpunit.

[Here](https://github.com/laravel/framework/issues/1181) is a description of the issue.

By putting the events definition to a separate function we allow writing tests for Node instances.