Add getNextIndex method to RaftAlgorithm
Switch self and leader use in equals check to avoid possible NPE
Add AppendEntriesReplyRandomizedInputTest

This test exercises the "APPLYING" and "PREFIX_SEARCH"
phases separately in a restricted fashion.

Resolves #24.