Initial unit tests and related adjustments

I like to use `rand_str()` in cases like this. It's a matter of preference, but my thinking is, if it's random, I can be sure I didn't accidentally use the same string somewhere else and getting a false positive.