Combine options and captures into state value

Instead of passing around a single options value and a single captures
value, pass around a single state value which includes both of those.
Predicates which used to take both values now have a before and an after
state instead.  The state's options component is mostly static (for
now).  The state's captures component changes as the regular expression
captures values from the target string.

This technique makes many predicates tail recursive that weren't
before.  It also makes the system easier to extend since new state can
be added without breaking existing code.

This fixes two 'todo' tests surrounding captures.

Closes #8