This code used to sit in the Mortar project as part of it's library.
This moves the code out of that library and into it's own dedicated
spot.
At this point it has just been moved- it does not necessarily work yet,
as it needs a few more changes to match the new class names and
namespacing.