Fixed catastrophic bug in handling of CALS tables. Also improved the docbook.xpl pipeline.

Probably shouldn't have these both in one pull request. I'm still learning how to make best use of this workflow.