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!
I think this ship has probably sailed and this is personal preference, but I don't much like the `exports.foo = function whatever` style. It makes for long lines, plus when you want to refer to the func defined elsewhere you have to refer to it off of exports.