Tweak for number of files opened by Lucene
Made DistinctPipe into a RonjaPipe
Allow Ronja to use lazy distinct when possible
Introduce StandardStore, similar to the The One Ring, a store to rule them all.

StandardStore implements and coordinates the infrastructure of being a store,
startup/shutdown logic and a common base interface for all stores. It takes as
input a store-specific format specification (StoreFormat), which describes how
to read and write records and any store headers.

The Store provides a cursor to navigate records, which may be augmented by the
StoreFormat to provide non-standard operations, like reading record fields
directly as opposed to deserializing full records.

This commit contains two store format implementations, NodeStoreFormat and
RelationshipStoreFormat.

The new stores are not plugged in, and so this commit does not change any live
part of the code base. It is meant as a first step, and a pause point to peer
review the current state of the code.

Remaining work, in proposed order:

o Plug new stores in to run side-by-side with existing stores, with existing
  stores remaining in charge of startup/shutdown procedures.
o Implement RecordTraversalLogic for expand() operation
o Implement all other store formats
o Move all code over to use new stores
o Make new stores responsbile for startup/shutdown and similar infrastructure
o Remove old stores.
Make sure that the StandardStore truncates the store file before mapping it with the page cache.

Also some assorted formatting changes that crept in.
Merge pull request #2982 from jakewins/2.2-standardstore

[2.2] Introduce StandardStore, similar to the The One Ring, a store to rule them all.
Add support for platforms that don't allow unaligned memory access
Merge pull request #3289 from chrisvest/2.2-unaligned-access

[2.2] Add support for platforms that don't allow unaligned memory access
Make the page cache cope well with AsynchronousCloseExceptions

It was possible for a stray interrupt to hit the page cache while in the middle
of a page fault. Such interrupts can cause the victim FileChannel to be closed,
leaving the page cache with a closed StoreChannel without its consent. This can
then cause further complications later on, because PagedFiles are flushed
before they are closed, and so the flushing can throw a ClosedChannelException
and in the end prevent the page cache from being able to shut down.

We now handle this much better, by making sure that the PageSwappers reopen
their StoreChannels whenever one the swapIn or swapOut methods throws a
ClosedChannelException. That is, unless the PageSwapper has been explicitly
closed.
Don't reuse HashMaps for transaction state if they've grown too big

HashMaps that are big use up a lot of memory and take a long time to clear for
reusing.
Ensures that Relationship commands in upgraded logs have proper first in chain flags

Previously upgraded logs would simply copy over relationships commands, leaving
 default values for the firstInFirstChain and firstInSecondChain fields. This
 could result in pointer chasing errors if these transactions were applied to an
 otherwise properly upgraded store, a scenario that comes up in backup. In
 particular, backup will copy the store and then the upgraded transactions,
 which would update the relevant relationship records to have
 wrong values for those flags, affecting pointer following.
 This commit checks if the currently transferred LogEntry holds
 a RelationshipCommand and if so it sets up the first in chain flags
 properly.
This approach, while improving on the problem, does not completely solve it.
 While the pointers will be interpreted correctly, the first record in a
 relationship chain will still have its previous pointer set to -1, which
 will overwrite the current value that represents the relationship count
 for this chain. This issue affects backups that are created
 immediately after an upgrade from 1.9 or 2.0.
Merge pull request #3290 from digitalstain/2.2-fix-log-upgrade

[2.2] Ensures that Relationship commands in upgraded logs have proper first in chain flags
Merge pull request #3292 from systay/lazy-distinct

[2.2] Lazy distinct for Ronja
Remove println in test
Merge pull request #3276 from lutovich/2.1-reduce-number-of-opened-files

[2.1] Tweak for number of files opened by Lucene
Tweak for number of files opened by Lucene
Merge pull request #3294 from chrisvest/2.2-async-close

[2.2] Make the page cache cope well with AsynchronousCloseExceptions
Merge pull request #3302 from lutovich/2.1-reduce-number-of-opened-files

Tweak for number of files opened by Lucene
Merge branch '2.1-maint'
Merge pull request #3301 from chrisvest/2.2-recordchanges-close

[2.2] Don't reuse HashMaps for transaction state if they've grown too big