Remove more applyUnapply cruft
Only flatten if args unapplied, allows undefined as arg in normal case
Add caseclass
Move predicates to top level