First version of kms_align_maps, currently functional but needs work.