First draft of thread spawner

It doesn't really control the program counter. It only resets it as part of spawning new threads.