Update AST with pattern matching functions

The functions are simply tested with a simple AST and simple pattern
(the main function is commented out at the bottom of the code).