Initial commit of all of the mosaic algorithm. Lots more documentation, tests, refactoring to come.