Updated plan.md, including many references to existing code.