Big refactoring, including:

- Make operators and getters distinct elements of ADT
- Add compare to [Term] and [Log_index]
- Add initial versions of various state machines
Merge branch 'fix-refactor-and-initial-state-handlers'