moved file i/o onto background threads for export

also updated the progress bar logic to work asynchronously
the document class lives in its own file now
ignore
cleaned up export code & run-termination logic