Changed worldThread into a thread and main thread now waits for world to be gened.