Added callbacks 'onAfterSuccess' and 'onAfterComplete' that can be used in tests to check specific conditions.
Fixed indentation
Added 'onAfterError' callback in line with others
Added line for onAfterError option and example usage of onAfterComplete
Fixed up code formatting
Refactored onAfter[X] logic to centralize overriding