Fix a few parsing bugs that can allow for silent truncation of valid JSON
Test case for Redmine 6369

Shows that array data accumluates over multiple bundle
invocations.
Clear array data before calling bundle as method

This re-establishes the behavior from 3.5.3, where array
data within a sub-bundle does not accumulate accross
multiple bundle invokations via methods promises.

It maintains the behavior where such data does accumulate
accross multiple bundle invokations via bundlesequence.

One could argue that the behavior or data accumulating would
be consistent with the declarative nature of CFEngine, but
given that CFEngine provides no means to clear an array in a
controlled way, this would require a uniquely named array for
each bundle invocation, which would be unmaintainable and render
methods promises and bundles useless as a means for abstraction.

Fixes Redmine #6369, see ticket for more detailed discussion.
Disable caching for functions that populate array

The function populates an array, so skipping the function call
is not an option, as the cached return value is not sufficient.

A second call of the same method (2nd pass) would first clear
the array and then skip the function call, leaving an empty
array.
Merge branch 'bug/json-parser' of git://github.com/worr/core
Add unit test cases for trailing commas in JSON structures.
Merge pull request #2010 from vohi/redmine/6369

Redmine/6369
Fix incorrect test count calculation on Solaris 11.

`wc -l` on Solaris returns a number with some padded spaces around it,
which sh doesn't like when comparing numbers later on, so the result
is wrong. This caused the script to return success, when it should
have returned failure.
Update test result status for Solaris 11.

All cf-serverd tests are passing now, yey! Also remove freebsd, since
we don't test it in Jenkins, and the mentioned Redmine ticket is not
for that platform.
Cleaned up lastseen handling and increased logging verbosity

Shouldn't have any effect in functionality.
Do not fail lookup even if db is inconsistent.
Raising logging level of lastseen db inconsistencies...

... at least for some time in master, so that we notice when it occurs.
No need for stupid risks.
Redefine what inconsistent lastseen db is

Document thoroughly via a bunch of tests.