Logic flaw in validation fixed... did not actually validate special blocks. Also validation now carries on after first failure.
Test for edge case in the debugging routines.
Major code tidy.
Merge branch 'master' into wipcasblocks

Conflicts:
	stack/cas/casstring.class.php
	stack/cas/castext.class.php
	stack/input/matrix/matrix.class.php