Added dispatchEvent() wrapper method.

Added a test case for dispatchEvent().

Fixed a typo

DocBlock updated

Wrapped _className property in App::className()

Fix failing test

Reverts 8fc59bd

Made $data optional

Fixed PHPCS issue.