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.
Added test for slave-only instance being elected coordinator
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
Added +UNWIND+ to Cypher

UNWIND can be used to transform a collection into individual rows.
Minor changes to UNWIND

o Added more a few more tests for edge cases
o UNWIND now does not remove anything from scope,
  only adds a new identifier for the elements
o Tweaked the documentation
Add UNWIND to shell
Logging performance optimizations:
* Fixed custom Jetty logger to caches isDebugEnabled
* Changed LogbackService to cache isDebugEnabled
* Added isDebugEnabled check before toString() in GCResistantCache

Only add security filter if there are security rules
Fixed merge issues
Add UNWIND to the browser
Merge pull request #2344 from systay/unwind

Add UNWIND to Cypher
Merge pull request #2365 from digitalstain/2.0-maint

Merge branch 1.9-maint into 2.0-maint
Merge pull request #2341 from rickardoberg/slaveonlyfix2

Slave-only instances no longer becomes master
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
Merge pull request #2348 from rickardoberg/optimizedlogging4

Optimize logging and HTTP filter
Merge branch '1.9-maint' into 2.0-merge-1.9

Conflicts:
	community/server/src/main/java/org/neo4j/server/logging/JettyLoggerAdapter.java
	community/server/src/main/java/org/neo4j/server/web/Jetty6WebServer.java
	enterprise/ha/src/main/java/org/neo4j/kernel/impl/cache/GCResistantCache.java
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
Merge pull request #2375 from chrisvest/2.0-merge-1.9

2.0 merge 1.9