Update phalcon_class_exists() to match PHP 5.4 behavior
Use php_error_docref() instead of userspace trigger_error()
Fix #787

* use phalcon_class_exists() instead of userspace class_exists()
* call wasFreshInstance() immediately after getShared()
Removed forgotten debug code
Typo fix
Test case
Modified the test case
Travis CI may be slow sometimes
Merge pull request #788 from sjinks/issue-787

initialize() won't be invoked if event handler calls getShared() to get already initialized object