Prevent missing first pagepreloaded event in pageflow.ready
Prevent missing first pagepreloaded event in pageflow.ready

The editor initializes the slideshow independently of the
`pageflow.ready` promise. This can cause the first `pagepreloaded`
event to be dispatched even before feature detection has finished.

In these cases `pageflow.ready` stayed pending and features depending
on `pageflow.ready` (e.g. lazy loading of thumbnails in the built in
navigation bar) did not work correctly.

Start listening for a `pagepreload` event on the document element
right away and track whether the event occurred with a promise.

REDMINE-16546

codevise/pageflow,codevise/pageflow,codevise/pageflow,tf/pageflow,tf/pageflow,tf/pageflow,tf/pageflow,codevise/pageflow