Patch Set 1: I would prefer that you didn't submit this; No score

This is interesting.  I have only taken an initial scan through the code, but I think there is a lot of potential here for something very useful for users.  Notes on some lines below.  Obviously we don't want to submit this in its current state, but I'm happy to see this bug being worked on.