Make it work with latest cordova-cli

A bunch of changes I needed to get this to work with my cordova-cli project, based on cordova 2.8.