Started concurrency tests.
Changed some function signatures.
Added debug-time concurrency assertions, added isSingleton, added option to turn off multithreading assertions, continued concurrency tests.