Mostly fixed validator.java (completely rewrote). Not commiting Tribex's
code (my version of it is still incomplete/won't compile)