All realm operations for the RPC are now done in their own thread so it can be allowed to block on waiting for callback results. The recursive and multi-threaded nature of this makes it pretty tricky, but it works!
This meant we needed to rename tests/lib to tests/js so they folder names would not conflict.