v2 of these patches need to be merged with Mark's part saving stuff. I've done this, but I'll hold off posting the merged version until this one is reviewed, unless anyone objects.