Add unit tests

Move the `guid` function into the test vs having it in the source lib, since we only need it in tests.