Test to ensure we can ratchet through HOTP values.

Also, fixed a bug in GenerateNextState