I made some progress with this and posted a new thread here.
I also put up a bounty on Stackoverflow.