Made mapping generation logic multithreaded.

Currently runs with 4 threads. Provides massive speedup!