Updated to work with cordova 2.7 and above

Updated codes and removed deprecated lines to work with cordova's latest version