fix up templates to use anchor and external fields.

Also delete library templates.