in reply to Speed, and my sanity.

I've put a few things in modules, and it is better now.

I have a few things longer than 400 lines: they are much easier to read...

A few things are still hairy, but it is getting better.

I figured if I put most of the neat functions in a module, than I could use them if I ever want to use some other templating toolkit.