various fixes to make check finish, tests for Matrix classing, reversed and tested clean/tokenize order