Build a more robust extraction of pattern-variables. Now a Visitor is used which tracks down all valid pattern variables.