Support Cordova 2.7

The plugin wouldn't compile with Cordova 2.7 due to some API updates.

(This is my first pull request ever on GH, so please let me know if I could improve anything)