Pab/devel

Relatively random set of changes:
- ALDORTEST snippets in library code are now tested as part of make check
- Better substitution of domains - there were cases where '%' would leak to top level and confuse the interpreter
- Better identification of dependent type variables
- Small guide.tex fixes and derived a couple of test cases (ought to be automatic, but later).