Refactored the mapper implementation and began adding some new tests.