[TIMOB-13040] Fixed scoping in hooks system. Added better error handling for bad hooks.
[TIMOB-13040] Fixed scoping in hooks system. Added better error handling for bad hooks.

salem/titanium,cheekiatng/titanium,cheekiatng/titanium,titanium-forks/appcelerator.titanium,FokkeZB/titanium,FokkeZB/titanium,titanium-forks/appcelerator.titanium,salem/titanium,titanium-forks/appcelerator.titanium,FokkeZB/titanium,cheekiatng/titanium,salem/titanium