Replaced DOMReady checks with immediately-invoked function expressions

Resolves issue #517