Started adding support for custom output via templates.
More work on output templates.