Adds new unit tests, refactors some old ones, and brings code into agreement with new unit tests

Signed-off-by: mpeter28 <marshallpeters@ymail.com>
Does a small clean up of the new unit tests

Signed-off-by: mpeter28 <marshallpeters@ymail.com>
Merge pull request #176 from mpeter28/master

Rewrite of unit tests