Embedding diagrams in Forester [00H5]

I would really like to be able to use Diagrams from within Forester, so I spent a bit of time working on a diagrams-forester preprocessor tool. The idea is that it will look for special sentinel blocks that look like

\diagram{w}{h}{\verb<<<|
  ...
<<<}
Then it would run the diagrams code in the ..., and replace the entire diagram block with an image link. diagram would also be defined to produce some kind of dummy placeholder, so the code would be valid Forester code both before and after the preprocessor runs.

I don't want to spend a lot of time on this, but it's definitely worth spending a few hours on this summer, so I wanted to get it off the ground. So far it can identify and parse the diagram blocks; I still need to hook it up to the diagrams-builder package and deal with things like input and output directories and so on.