Add support for pattern matching 

Implemented as pattern matching macro that inspects sub patterns and generates an extractor that extracts requested fields out of the record. 
Fixed