Factor error message generation into a separate file; add '-tc' flag to domtool-client