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

move filter to helper_locals

remove the bloody stuff that doesn't bloody belong here
Merge pull request #462 from dethe/rewrite_legal_urls

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