Add safeguard when reading timestamp from cf_promises_valid.

If the file contains valid JSON, but is missing the timestamp field,
then the attempted fetch of the value will crash, leaving all daemons
dead in the water.
Separate validated and release_id information into separate files.

The base problem is that only the policy server has enough information
to generate the release_id, most notably because the server will have
a git repository with a tag, whereas each agent will not. Therefore
the agents will generate a different release_id, based on file
contents. Add to the problem that stale files at each agent can also
influence the result, and you have a mess. Therefore only the policy
server should be allowed to generate the release_id.

This is a problem because each agent must be able to generate
cf_promises_validated, so that it can trigger a policy reload in its
daemons.

The problem is solved by separating those two pieces of information
(timestamp in cf_promises_validated, and releaseId in
cf_promises_release_id). All agents generate the former; only the
policy server generates the latter, with other agents downloading it.
datastate() function to provide the container used by default templates
Redmine#3454: rename string functions to string_*
Merge pull request #1328 from tzz/feature/3454-text-manipulation-functions-rename

Redmine#3454: rename string functions to string_*
Merge pull request #1047 from tzz/feature/datastate

datastate() function to provide the container used by default templates
examples/datastate.cf: add example of new function
Do not call IsDefinedClass before defining in_range_defines, out_of_range_define

These are not expressions, but classes.
Do not use IsDefinedClass for attribute environment_host

This is not an expression, but a class reference.
Remove namespace parameter to IsDefinedClass
Merge pull request #1325 from kacfengine/separate_release_id_file

Separate validated and release_id information into separate files.
Fix wrong argument after signature was changed to func(void).
Incorporating feedback received via github

- Using "Call Collect" in a uniform way.
- Small code refactoring.
- Changed the name from CollectCallPending to CollectCallHasPending
Removing partial destructors
Removing partial constructors
Fixing typo
Move test for enterprise plugin to the enterprise repository.
Merge pull request #1331 from kacfengine/move_enterprise_test

Move test for enterprise plugin to the enterprise repository.
Merge pull request #1307 from cduclos/call-collect-agent

Incorporating feedback received via github
Remove leftover function declaration.