Add CODE-tag processing

This extends the existing "fenced" formatting logic to work with CODE tags. Previously it was only used for NOTE and NOTES tags.

Note not much code needed to change as this reuses a lot of the machinery set up for appendix "note"s