Complete web purchase from message (bug 1101995)

@muffinresearch r?

I've only tested with a dummy html page but it should work with your patch!
My original reasoning for it was so one doesn't have to repeat the function name down below in the returned dictionary. However, I've noticed it's always helpful to use a named function so one has to repeat the name anyway. Thus, I could come around to always using named functions and exporting them at the bottom. Whichever style we go with, it just needs to be consistent throughout.