First shot at extracting mapping functions so they can be used more like plugins
Add helper function for extracting attribute values