[bug973112] - Moved error tracker to a separate file, change 'onerror' to 'eventListener'

[bug973112] - Modified eventListener