Fixes issue with role election in cluster

Introduces tests and fixes for some edge cases that role election
 may come up against
Votes received that are actually delayed responses from a previous
 election could lead to wrong results. This is now guarded against
 by having versions marking elections and vote requests/responses
Election results could be reordered if one would fail to be
 broadcasted. Now this is guarded against by an election epoch, allowing
 election results to be ignored.
Instance and vote count could become wrong if an instance voted
 and then was marked as failed before the election finished. That could
 lead to cases where the role holder was not asked for a vote. Now,
 ElectionContext registers as a HeartbeatListener and will invalidate
 votes of instances that have failed.
This is added with backwards compatibility, so elections initiated by
 previous version instances will still go through and receive proper
 responses.
Merge branch '1.9-maint' into 1.9-election-fixes
Fixes so that slave-only instances not only try not to win elections, but actively don't switch to master in the case they are coordinators (e.g. because the instance created the cluster)

Conflicts:
	enterprise/ha/src/main/java/org/neo4j/kernel/ha/HighlyAvailableGraphDatabase.java
	enterprise/ha/src/test/java/org/neo4j/ha/TestSlaveOnlyCluster.java

Conflicts:
	enterprise/ha/src/main/java/org/neo4j/kernel/ha/HighlyAvailableGraphDatabase.java
	enterprise/ha/src/test/java/org/neo4j/ha/TestSlaveOnlyCluster.java
	enterprise/server-enterprise/src/test/java/org/neo4j/server/enterprise/StandaloneHaInfoFunctionalTest.java
Added test for slave-only instance being elected coordinator
Fixes bug in transaction state wrt indexes

When an index had been added to a transaction, for a particular label and property,
and the store already had a committed index for that particular label but a
different property, and you tried to look up that index, e.g. to examine its state,
then we did not properly filter out the uncommitted index when we applied the
state of the transaction to the lookup results.

This fixes #2279
Make shell bind to correct host.

- RMI is hard-coded to bind to a host specified by a system property, this
  circumvents that by passing in a custom socket factory.
- No fix provided for 1.9, since the host option was introduced in 2.0.
  1.9 users can still specify the host to use by setting the
  java.rmi.server.hostname system property.
- Add remote_shell_host to docs and default config files
Makes election respect elector versions.
Merge pull request #2374 from chrisvest/2.0-index-lookup-tx-state

Fixes bug in transaction state wrt indexes
Merge pull request #2373 from jakewins/2.0-shell-host-fix

2.0 shell host fix
Ability to return paths with diminishing cost from Dijkstra/TraversalAStar

Algorithm object accepts parameter whether or not to retain sufficient
information to be able to, in addition to returning the best path(s),
continue to return paths in order of diminishing cost. Retention requires
more memory and has some performance impact as well, but only if enabled.
Merge pull request #2321 from tinwelint/1.9-best-first-carry-on

Ability to return paths with diminishing cost from Dijkstra/TraversalAStar
Updates elector and version in all incoming election results
Merge pull request #2314 from digitalstain/1.9-election-fixes

Fixes issue with role election in cluster
Fix compilation on Java 6.
Merge branch '1.9-maint' of github.com:neo4j/neo4j into 1.9-maint
Also fix compilation of tests in Java 6
including javadocs in manual
whoopsie
Fixes for bringing javadocs next to the manual in 1.9.x.
not publishing components anymore