Added multithreaded and multiprocess simulation.

Speed-up is somewhere around 30-40%.