Add random seeds to tests per #1044

Adds random seeds to tests that use `np.random` but did not previously have seeds.
Also, switch to `random.rand` in place of `random.random`, since `random.random` demonstrably does not honor `np.random.seed`.