Move retry logic into its own class

The only change in retry behavior is addition of a retry-type (custom)
that allows for additional filtering by include-filter or subplan. TODOs
include:

- distinguishing command-line excludes from known-failures
- distinguishing command-line includes from plan includes

Enabling these distinguishments will allow us to completely delete
unsupported filters (such as --exclude-filter on retry).

bug: 36162565
bug: 36136217
bug: 36337428
Test: run cts-dev -r 0
Change-Id: I49ba463417bbfa8b1ef69466c54bbb8b83b2fa8d
9 files changed