Pattern parser

Changed test case to make it more flexible
Pattern parser (continued)

Created an intermediate object to simplify reading & coding