Move setTimeoutWithProgressbar to main.js

This is probably fine, but we might want to move to window.performance.now(): it has higher resolution and is guaranteed to be monotonic.

Check out Tony Gentilcore's comments [here](http://updates.html5rocks.com/2012/08/When-milliseconds-are-not-enough-performance-now).