Move bussiness logic behind sync from EDT to a background thread.
Also this patch introduces support for progress indicator.