Check if passed tag.filter is a valid sorting/filtering function before use to fix #167