[#7] Tidy up the cordova.js middleware.