Updates plugin to work with Cordova 3.x

If this looks good, I can squash commits.