Hi! After some serious testing and discussing a few of the changes with Evan, we decided to merge this patch. I had some trouble applying it, since it is somewhat old and my git skills are not the greatest, so he will just push it, so please consider it signed-off.
Thanks a lot, Evan! This is a challenging patch, but it cleans up a lot of the code and makes things effectively simpler, which is always good. felix