refactor: fixed progress reporting

Fixed code duplication, event handlers moved out from functions.
Better progress reporting.
test: file retry tested
Merge branch 'Next' of github.com:AidasK/resumable.js into Next