Print stack trace to console in case of a javascript error.

The stack trace now provides useful line numbers since both platforms
support runInThisContext. Since there is now a try-catch around _notify
the application will continue to run and not crash entirely.

Change-Id: Iaf497b2c6b30b9ebfec9ee55ac4679351826876e