Clean up the code for loading filters from config files.

Now relies on a factory method that can be specialized on a per-filter
basis. This is a bit less nasty in terms of implementation (the code to
initialize the filter in the factory method is now packaged with the
filter itself), but still requires modifying the top factory function when
adding new filters. Because we link as a static lib, I don't think there
is currently a way around this atm...