Context support and optional parameters fix

- Make use of ContextErrorException class.
- Fixes the error handler signature according to PHP specification.