Test compatibility

Allows the test to run in older browsers that either fail on `insertBefore` used with a single argument, or when the calculations cannot be made on elements inserted outside of `document.body`.