Add toString methods for match-pattern and rules