Added progress bar and refactored scripts
Javascript refactoring