Use predicates to specify records to accept or ignore
This branch refactors the RecordReader used by various protocols to make it easier to specify which rules for which records the reader should accept or ignore. Currently this is implemented in a different way for each protocol, and I didn't feel like doing it again for the handshake protocol.
Part of #1232 (closed).