Override rand() in test

This is a hacky solution to override the rand function so the HMM can be
deterministic when using `make test`