Filters as functions

The first commit is basically a rename.  The second commit is the one that matters.  This enables us to share code for things like a "Markup filter" in a sensible way (and eventually other filters).