add pluggable EOF handlers

I'm hoping that by putting the EOF handling into a handler instance, the
JIT will be able to easily optimize the usual case (of only standard
handling), since there'll only be one implementation of the class; it'll
be easy to prove it as a monomorphic site. This will only possibly
change after the first invocation of `ignoreEOF`, which for my purposes
will only happen in testing. This may be premature optimization
(especially when taking branch prediction into consideration), but it's
not much more complex than a boolean flag, so I may as well do it this
way.