Converting a jQuery Mobile Cordova application over to vanilla JS and writing additional functionality