Allow assigning filter function from UI, fix saving filter functions.