Introduce pooling of KernelTransactions.
Wrap text in editor before the buttons.

* Adds 52 px margin-right
* Fixes #3223
Resolve two race conditions relating to HA lock sessions

- Adds a check ensuring a slave commit has a running lock session when committing,
  or has explicitly opted out from having one.

- Moves lock session management into its own class, where timeouts and concurrent
  access can be tested in isolation.
Revert the change which adds count values in the state on read

- it is indeed better to delegate the caching to the page cache used in the CountStore
- having less values in the in-memory state will also make the sorting much faster when we need to merge them
  with the one on disk
Increase key-value record size to 16 + 16 bytes

- change node and relationship key encoding to write a type byte
- extract CountsStoreWriter and added tests
- fix a bug in the binary search when reading entries ordered by key
Stop visiting records when reading an empty one from the page
Add tests for CountsStore
Extract record serialization outside the CountsStore

Now the CountsStore accept generic keys
Change CountsStore.get to accept a register rather than returining a long
Make the counts store generic on values type
CountsStore takes a WriterFactory rather than creating a specific CountsStoreWriter
Repackaging to separate the concepts of KVStore and CountsStore

- revisit KeyValueRecordVisitor to be generic
- the specific CountsStore visitors uses registers rather than passing aroung longs
Fixed issue with input iterator starting too soon

CalculateDenseNodeStage was set up before executing NodeStage, accepting
an iterator of InputRelationship. Calculating the dense node count might
depend on IdMapper to be prepared. IdMapper was prepared after NodeStage
was done. Problem was that the Input used in this test wrapped the
iterator in a resource iterator that retrieved its first item in the
constructor and so made the first InputRelationship pick invalid node ids.

Effect of this would be that the node degree would be off by one for a
select few nodes.

Fixed by using PrefetchingResourceIterator instead which fetches in
hasNext, which is expected in most places.
Fix a page cache bug that can lead to lost updates

The problem was in the MuninnPageCache#evictPages method, in that we released
the write lock on the newly evicted page before we attempted to grab the write
lock on the translation table, for removing the evicted page. This left open a
window where another thread can do a look-up in the translation table, observe
the page that we have just evicted, complete a page fault, and then the
eviction thread would get the lock on the translation table and remove the page
that was just faulted in. This is the bug.
Later, another thread would find that the translation table does not have an
entry for the page it wants, so it faults it in. Now we have two cache pages
that are bound to the same file pages. If both are written two, then one will
overwrite the other when they are evicted. This is the symptom we observed in
our tests.
Increase the potential parallelism of page faulting

... by releasing the write lock on the translation table sooner. This way,
other page faults to the same stripe can proceed, while page faults and lookups
for the specific page will wait like they've always done. Except now they're
waiting on the lock on the page itself, instead of waiting on the lock for the
translation table. We ensure this by grabbing the write lock on the page we are
faulting into, before we add it to the translation table and release the lock
on the translation table.
Merge pull request #3269 from tinwelint/2.2-pbi-degree-inconsistency

[2.2] Fixed issue with input iterator starting too soon
Merge pull request #3254 from davidegrohmann/2.2-ref-counts-store

[2.2] Counts Store refactor to be based on a generic KV-Store
Re-enables parallel I/O in batch importer
Add additional tests for X-Forwarded-Host

Against Cypher REST response, and slash redirects
Changed the code so that the transactional endpoint creates URIs based on the request URI (rather than the server's URI). This is better (the server doesn't usually know it's own URI, whereas clients do) and enables X-Forward headers to work, fixing the problem identified in https://gist.github.com/albertoperdomo/6f3d7ffcb1351e5c61ce

However, /db/data and /db/manage (note: no trailing slashes) are not fixed here. That is a different bit of code to tame.