Complete working part 1. Parallel mode now handles quit and mode change as normal. No memory leaks or error when checking with valgrind