Sets a threshold in ArrayCollection where array is recreated if surpassed

this to avoid big arrays with all its references still set. This is an
artofact of the very purpose of ArrayCollection, that clear() should be
as performant as possible.
Fixed an error where a slave cannot become alive to a master in a cluster.

The error was caused by a race in alive msg and fail msg handling procedure.
Integer and Float are not coercible to Boolean
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 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
Merge pull request #3662 from davidegrohmann/2.0-number-not-coercible-to-boolean

Integer and Float are not coercible to Boolean
Fixes shutdown issue with TaskExecutor

where a shutdown caused by task failure might not be able to complete.
Merge '2.0-maint' into 2.1-maint

Conflicts:
	community/cypher/cypher-compiler-2.0/src/test/scala/org/neo4j/cypher/internal/compiler/v2_0/symbols/TypeSpecTest.scala
	community/cypher/cypher-compiler-2.1/src/test/scala/org/neo4j/cypher/internal/compiler/v2_1/ast/AndTest.scala
	community/cypher/cypher-compiler-2.1/src/test/scala/org/neo4j/cypher/internal/compiler/v2_1/ast/OrTest.scala
	community/cypher/cypher-compiler-2.1/src/test/scala/org/neo4j/cypher/internal/compiler/v2_1/ast/XorTest.scala
Merge '2.1-maint'
Fix broken test
Merge pull request #3655 from tinwelint/2.2-avoid-big-reference-array-arr-coll

Sets a threshold in ArrayCollection where array is recreated if surpassed
Removed the overhead of CandidateList
Include relationship types in plan description.
Unify Expand{ByName/ById} pipes

Instead of building different pipes for relationship types that are known
at planning time and the ones that are not, we now lazily initialize fetch
the relationship type ids, and only ask to traverse by the types that
actually exist at the point in time when the query executes.
Merge pull request #3667 from tinwelint/2.2-bip-task-error-fix

Fixes shutdown issue with TaskExecutor
newline in the end of multi-line InputEntity toString
Store migrator sets base tx checksum if migrating empty store

since there's this convention that txId=BASE_TX_ID has checksum
BASE_TX_CHECKSUM. This logic exists in some places and StoreMigrator
now follows that convention as well to avoid checksum mismatches.
Better package for import-tool ComponentVersion

The ComponentVersion class for the import-tool was shadowing the one for kernel.
Merge pull request #3677 from tinwelint/2.2-base-tx-checksum-empty-migration

Store migrator sets base tx checksum if migrating empty store