Cordova file plugin wait till all's loaded


I successfully implemented and tested the cordova file plugin in the simulator and on my test iOS device. However, after a few runs on the device, I now start getting several errors, while it worked innitially:

[Error] Error: Can't find variable: LocalFileSystem
[Log] deviceready has not fired after 5 seconds. (cordova.js, line 1174)
[Log] Channel not fired: onPluginsReady (cordova.js, line 1167)
[Log] Channel not fired: onCordovaReady (cordova.js, line 1167)

I guess it’s best to wait with my app till all is loaded up, right now my app starts as:

$ionicPlatform.ready(function() {
// do some stuff

<body ng-app="starter" class="platform-ios platform-cordova platform-webview">

I was reading to use the real document.ready function instead of the ionic.ready function. However, it seems I’ll have to wait even longer for onPluginsReady and onCordovaReady. How can I wait for all three events to finish before I start the app? How does LocalFileSystem add into this logic?

Here’s what I get in the XCode output while running:

Apache Cordova native platform version 4.0.1 is starting.
Multi-tasking -> Device: YES, App: YES
Using UIWebView
[CDVTimer][handleopenurl] 0.126004ms
[CDVTimer][intentandnavigationfilter] 1.711011ms
[CDVTimer][gesturehandler] 0.086010ms
[CDVTimer][file] 29.130042ms
[CDVTimer][splashscreen] 29.661000ms
[CDVTimer][statusbar] 19.951999ms
[CDVTimer][keyboard] 0.297010ms
[CDVTimer][TotalPluginStartup] 82.224011ms
Resetting plugins due to page load.
Finished load of: file:///var/mobile/Containers/Bundle/Application/5797F97A-2963-4158-9D97-8A48DD6DCEC1/

Does the Resetting plugins mean anything?