Refactor test cleanup, improve doc/reduce lint.