Moved JS code to index.js file in cordova-basic. Added console and error redirection ahead of scripts.