Moved checkIfNewVersion function to update.js, added test, update index.js