Implement behavior common to a RaftActor in all it's states

The common behavior for a RaftActor is
- Change state to follower when it receives a RaftRPC with a newer term
- Increment the applied state of the commitIndex of the AppendEntries message
  is higher than it's applied state

Change-Id: I1fc0cdcb90368f3c07f555b307ac827286386651
Signed-off-by: Moiz Raja <moraja@cisco.com>
Merge "Implement behavior common to a RaftActor in all it's states"