@adamcrews
Add unit tests and minor other cleanups
f5b5fa7