Move GridSampler into common package and refactor to ready it for use with Data Matrix