Refactored matlab ast and the patterns to simplify operations.