Pull external editor logic out into its own class

Also point mcp-local-edit plugin at that class.

TODO: lambdamoo-style local edit