Fixed page initialization when test libraries (such as jQuery) override window.onload.