Move the error templates up into core.

Closes #390.