BUGFIX: closing the window while running a refinement causes an error. Fixed.
BUGFIX: small changes to the code to allow a smaller virtual memory footprint so HPC jobs don't get killed. Python 3 has a better fix for this https://docs.python.org/3.5/library/multiprocessing.html#multiprocessing.set_start_method.