Extended DOM ready check

Make DOM ready check work when load event has already fired. This allows addToHomescreen to be called later on, e.g. as a RequireJS module.
Otherwise a call to show will infinitely repeat and never succeed.