Improved multiprocessing

Additional processes are now only created as they are needed. Also
allows for easier integration of logging.