Multithreading tests

Ugly, but probably working. DO NOT MERGE