Reworked ansi filtering to be more functional

It's fucking dense, but I'm not sure I can help it.
Fixed up filter predicate system