TeXMath reader:  refactored handling of default alignments.
TeXMath writer: properly handle cases environment.
TeXMath reader: handle matrix, smallmatrix.
TeXMath writer:  only use ams matrix environments if amsmath in env.