Batch writer thread empties buffer into channel

instead of each append call, which allows for less calls to
FileChannel#write and less I/O wait for append threads.
Synchronized shutdown, since the log channel needs external synchronization
Correctly builds collision information in StringIdMapper

in the rare case of colliding encoded values. If one or more values encode
to the same long value a collision map must be built with their actual
values to be able to correctly find those values later on. Normally, if no
collisions are detected this information can be thrown away and that's
indeed why it's thrown away eagerly in favor of less memory usage.
Makes StringEncoder absolutely garbage free
Extract plan rewriting into it's own class
Refactor unnestOptional

Since refactoring happens on already valid logical plans, we do not need to go
back to the original QueryGraph. We simply trust that the incoming plans are
valid.
Added argument ids to LogicalLeafPlan
Rewrite two consecutive Selection plans into a single one
Make OuterHashJoin able to work on multiple keys
Plan OPTIONAL MATCH using both Apply/Optional and OuterJoin
Remove unused utility code
Merge pull request #3306 from systay/unnest-all-the-things

[2.2] More plan rewriting
Merge pull request #3303 from tinwelint/2.2-bip-collisions

[2.2] StringIdMapper collision handling
Fixes array values parsing issues in Extractors

where an empty input value "" would return [null], or [0] in long[] case,
very unexpectedly. Also added more tests to verify this behaviour in some
corner cases.
Merge pull request #3310 from chrisvest/2.2-remove-unused

[2.2] Remove unused utility code
Merge pull request #3283 from tinwelint/2.2-empty-log-buffer-in-force-thread

[2.2] Batch writer thread empties buffer into channel