Route online/offline events from document to window

@jkeshavarzi @EricLeiLi r?

@tracyli can you please test this today? See "Events" in cordova docs for details and test against regressions in blackberry.app events.