Added template tests, and changed the templates to simplify it.  Still have more work to do tomorrow