fn to wait for cordova deviceready

Like jquery's $(document).ready, will execute
immediately if event has already passed