Inline the flush
Detect 'interactive' ready state

The readyState value should be 'loading', 'interactive', or 'complete'
while 'loaded' appears in old WebKit browsers.

The document 'DOMContentLoaded' event is associated with 'interactive'
and may be fired before sub-resources (e.g. images) are fully loaded.

This change also skips adding an event listener if the DOM is ready by
the time the domready script is executed.
Merge pull request #26 from macu/master

Check "interactive", skip stuff if already loaded