Make FilterAction and FilterController composable

Also, refactor the code a bit. Add some more tests.