Initial pass at adding some tests for the functions here. This is not complete, so more tests will be added in time.