at startup of the node, commit index will have the index of last comitted entry

also (very) minor refactorings