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.
Handle pruning old format logs, Fixes #2265
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
Merge pull request #2343 from jakewins/1.9-prune-oldlogs

Handle pruning old format logs, Fixes #2265
Changes ClusterSettings.server_id to be an InstanceId instead of an integer
Properly closes XaLogicalLog at tests end
Merge pull request #2353 from digitalstain/1.9-maint

Changes ClusterSettings.server_id to be an InstanceId instead of an integer
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
Merge pull request #2348 from rickardoberg/optimizedlogging4

Optimize logging and HTTP filter
Makes election respect elector versions.
Shebang lines must have a ! in them.
Merge pull request #2381 from chrisvest/1.9-fix-shell-shebang

1.9 fix shell shebang
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