Basic unit tests

Added very basic tests for the public functions.  Please don't hesitate to comment on style or layout -- I am happy to make changes here.