Bumped up requirements to PHP 5.4
Aesthetic fix.
Refactored to new events.
Tests and fixes.