Support for Cordova 4.0

I submitted some changes to support Cordova 4.0 which is already available.