Compatible to Apache Cordova 3.1. Added comments