Refactored matching to only require one pass through to match and get
path parameters.