Text replacement rules

Added support for replacement rules on incoming messages.