[#282] implemented a listener to output to stderr when en 'error' event is emitted

[#282] moved the error event listener to the stub in phonegap.js init and out of object definition