Split test_spawn into more unit tests

The previous implementation of test_spawn consumed GBs of RAM during
compilation because it did too much in a single file. All parts that were
independent of test_spawn itself have thus been separated.