Refactor to store the ticket type

A ticket in the Incidents queue is of type Incident, so there is that
small change in the incident if.  TicketType can also return undef so we have to
guard.

We use the ticket type to skip doing other replacements.
Start returning early if we're acting on a non-RTIR ticket.

Otherwise, example.com or email addresses anywhere in the history of a
ticket in the General queue ends up with links off to
/RTIR/Tools/Lookup.html.  Normal users have no idea why those links are
there and they're frankly ugly and cluttering outside the RTIR workflow.
Merge branch '3.0/disable-rtir-linking-outside-rtir-queues' into 3.0-trunk