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.
Merge pull request #30 from allengeorge/randomized_appendentriesreply_test

Randomized appendentriesreply test