Correctly handle DOM Ready states

Previously, if the script was loaded while in `document.readyState` of `interactive`, the `domReady` function is never called.

See https://developer.mozilla.org/en-US/docs/Web/API/document.readyState for explanation of the proper detection of `DOMContentLoaded`
Merge pull request #2229 from chaffeqa/patch-1

fix(ready): correctly handle DOM Ready states