Convenience function to fill a buffer with random bytes. Add some unit tests (only sanity checks, really.)