rename relterm to term
implement -with-table option
move judgement writer to separate module