Fixes #6024: Adds support for ":before" and ":after" events
After events cannot be cancelled, all handlers always run.

Conflicts:
	engine/lib/elgglib.php
Improved inline docs
Clearer logic