fix tests
a little sprucing up
some forgotten stuff needed by term parsing
start of term lexer