JSON Serialization Performance

Don't flush when the Jackson UTF8 buffer is full but when the http stream flushes
Fix flaky tests, that rely on HasMap order (Java7 vs. Java8)
Avoid calling FileChannel#size() over and over since it's slow on Windows
Merge branch '2.1-maint'

Conflicts:
	community/kernel/src/main/java/org/neo4j/kernel/impl/store/AbstractDynamicStore.java
Merge pull request #3646 from jexp/json-serialization-performance

JSON Serialization Performance
Merge branch '2.0-maint' into 2.1-maint
Statistics divergence - query planned before data

If there is no data in the graph matching the basic components of a
query the statistics will be exceptionally poor for the planning. It is
important to ensure that such queries be re-planned as soon as possible.
The previous logic would produce numbers (Infinity and NaN) that made
divergence computation impossible, and even in the cases where it would
be possible to compute divergence, a statistics vector with all zeros
(which would be the case if the graph contains no data) would never be
considered diverged, regardless of how much the data changed.
This change set ensures that no impossible statistics are ever produced,
and introduces a special case for all-zero statistics vectors, falling
back equality comparison between the vectors in this case.
Merge remote-tracking branch 'upstream/2.1-maint'

Conflicts:
	community/server/src/test/java/org/neo4j/server/rest/transactional/ExecutionResultSerializerTest.java
Javadoc fixes for GraphDatabaseService.
Merge pull request #3665 from jotomo/javadoc-javadoc-javadoc

Javadoc fixes for GraphDatabaseService.
Merge pull request #3664 from davidegrohmann/merge-2.1-master

Merge 2.1 in master
Merge pull request #3663 from thobe/2.2-statistics-divergence

Statistics divergence for query planned before any data has been created
Merge pull request #3647 from S124568/2.2-fix-instance-not-alive-after-receiving-heartbeat

Fixed an error where a slave cannot become alive to a master in a cluster