IE stack trace fix.

Fix stackTrace() in preamble.js to support IE10 and IE11. Reuse code between library.js and preamble.js.