Simplify tests and add merge test
Cleanup sort templates and add merge routine