Fixing up some oddly worded parts of the caching documentation.
Make sure not to hit the parser on every Cypher query in the server
Refactoring: Split query preparation between parsing and plan building

Rationale: This makes it possible to check if a query isPeriodicCommit without having to open a transaction

Signed-off-by: Jakub Wieczorek <jakub@neotechnology.com>
Avoid opening two transactions per single request REST transaction

This introduces caching of PreparedQueries in ExecutionEngine.  The cache adds a tiny overhead for all calls to execute/profile
but this is much less than opening two transaction just to check if a query isPeriodicCommit.

While it would be possible to tie the prepared queries cache and the plan cache together, this would complicate matters
with plan cache flushing, hence we don't do that for now.

Signed-off-by: Jakub Wieczorek <jakub@neotechnology.com>
Merge pull request #2711 from jakub-/server-parser-hotspot

Server hotspot around parsing too often and opening unnecessary tx
Only hit prepared query cache when planning (avoid extra lookup)

signed-off-by: Jakub Wieczorek <jakub.wieczorek@neotechnology.com>
Merge remote-tracking branch 'upstream/2.1-maint'
Merge pull request #2721 from boggle/master

Merge 2.1-maint -> master