Some work on unit tests for core function

- a step toward confidence