Multithreaded

Added multithreading and fixed an excessive rendering bug.

Tested, working, and ready to merge.