Well, I can post more code, but I'm really uncertain about which parts are relevent.. there's a lot of it and I don't really think posting it all is a fair use of your time. I'm not a programmer by trade, so how to discuss these things isn't really clear to me.

Could you expand on what it means to "move the thread into its own context?"