Refactor to be non-static, fully tested, php 5.2+ compatible, beforeNotify function

This diff of this will be awful