Refactor out more logic
- Separate pattern matching from RewriteConditions specifically so it can be
  reused for RewriteRules
- Separate out string formatting from RewriteConditions specifically so
  it can also be used for RewriteRules
- Limit access to context object by providing some logic as callbacks.