Refactor to make it easy for others to add screen capture to their extensions

This seems to work. I've only tested it lightly. I'm happy to fix/improve things.

I plan to change the page/extension communication to use a port in another branch. That will eliminate (or at least greatly reduce) the possibility that an extension using this code gets its wires crossed with incoming messages.

Fixes #11