Using proper ready events for phonegap > 2.x