Add commands for working with serialised terms

In particular, IDEs can now request the implicit and explicit versions
of previously-output terms. They can also request normalisation.
Send original terms in error messages

This allows IDE users to normalise terms or show implicits in errors.