fix for bug 985737, relies on PR 82 on legal-docs

respond to feedback from @ngokevin

moved filters to own file, added tests

oops, forgot to rename all the things

rename tests

one more try

remove console logging

remove dead code