Add unit tests for web filter "usage", cleanup some code