Use API functions based on availability

Hi,
I'm using es6-module-loader in a custom javascript environment and made these changes to avoid errors.
I have a window object, but do not have a document.getElementsByTagName, I have an XMLHttpRequest but no require.

Hm, that is a good question. You're right, name should never be void, that would not make sense.
Maybe just assert that it is not void?