Fix so that instances can crash and rejoin with a restarted election version

Conflicts:
	enterprise/cluster/src/main/java/org/neo4j/cluster/protocol/atomicbroadcast/multipaxos/context/ClusterContextImpl.java
Updated UDC docs
Added RepeatRule from other branches
Fix a memory leak in RerferenceCache

The leak was caused by the fact that when inserting new data in the cache
noone is cleaning up the old GCed values still present in the cache.
Indeed the cleanup was triggered only by updating existing node which have
been GCed or at some extend by getting GCed values.

This PR also tries to improve the polling when during get/remove by looking
to the whole queue instead of just removing the single element.
Merge pull request #2695 from davidegrohmann/1.9-fix-leak-ref-cache

Fix a memory leak in RerferenceCache
Fixed failed master catch-up after rejoining cluster
Fixes after code review
Merge pull request #2715 from lutovich/1.9-maint

Fixed failed master catch-up after rejoining cluster
Fix compilation error
Don't skip relationships in the cache on rollback.

When loading relationships for a node, and the relationship chain
has been partially loaded, it was possible for another transaction
to make modifications to the next relationship to be loaded for
that node, but without loading it through that node (by loading it
through the other node of that relationship). If that transaction
rolled back it would make the cache skip loading that relationship.
Merge pull request #2769 from thobe/1.9-partial-relchain-load

Don't skip relationships in the cache on rollback.
Get rid of warnings around snippets in the ACL example.
Merge pull request #2792 from nawroth/1.9-maint

Get rid of warnings around snippets in the ACL example.
Correctly quote arguments to tr
Reset of election version is 1 and not 0 apparently
Remove use of non-versioned voting

Conflicts:
	enterprise/cluster/src/main/java/org/neo4j/cluster/protocol/atomicbroadcast/multipaxos/context/ClusterContextImpl.java
Removed backward compatibility test
Make sure we always send VersionedVoteData by asking with proper VoteRequests

Conflicts:
	enterprise/cluster/src/main/java/org/neo4j/cluster/protocol/election/ElectionState.java
Merge pull request #2808 from cleishm/tr-quote-fix

Correctly quote arguments to tr
Merge pull request #2813 from digitalstain/1.9-versioned-election

Backport of the removal of versioned election compatibility
Uses the cancellation request to replace interruption for state changing tasks

This interface captures the notion of the request to cancel a
 running task. This involves the actual checking but not the
 notification mechanism, which is application dependent.
The driver for this is properly cancelling state change in HA

Removes the use of Thread.interrupt() for cancelling the task that is
 currently switching state. Interruption had the capacity to cause
 unwanted side effects to IO operations.
The Future that is attached to the currently running task is actually
 waited for, ensuring no two threads are stepping on each other's toes
The SwitchToSlave task checks at convenient points during the store copy
 if cancellation has been requested and properly aborts, while cleaning
 up. This will be revisited
Adds comments to key methods and adjusts a test to work with the new way
 of cancelling.

Refactors master HA URI to make structure more clear

Adds two cancellation points in SwitchToSlave

Adds defensive check for switching to slave for ourselves as master

Also adds a catch clause around the get() for the Future of the
 task switching, when there is the need for cancellation
Adds a test for the added check
Merge pull request #2831 from digitalstain/1.9-cancel-state-switch

Properly cancel state switch tasks