Make PHP errors interceptable via event
Refactoring, add events
Base code for methods