Add small snippets of external shim and polyfill JS.
More wip API cleanup.