Massive overhaul to how core filter plugins are being defined.

This is improving code re-use and mantainability, so further plugins will no longer be copy-pasted or something. There are still things to sort out and improve, though.