Add a before notify callback

I have been unable to test this because the testing framework doesnt seem to be working right now.