Bug #2057 - Messages from edit_xml operations do not show the xpath

Improved error messages for edit_xml promises:
- include more useful information in error messages, such as select_xpath and name of XML document being edited
- verify cfPS() parameters, such as cf_error or cf_verbose
- improve general appearance of messages, such as punctuation and whitespace

Correct SanityCheckTreeInsertions() so that there are not error messages on multiple passes, when inserting a tree into an initially empty file.
Merge pull request #330 from shaunamarie/bug2057-xml-messages

Bug #2057 - Messages from edit_xml operations do not show the xpath
Fix for 1804

At creation time we were always assigning 0600 as mode to the new file.
This fix stats the source file first and assigns the same mode as the
original file.
Acceptance tests are updated too.
Merge pull request #332 from cduclos/master

Fix for 1804
Unsilent error when lsdir() is not able to read the directory
Rename update.cf bundle names to fit internal naming schema.
Change BufferNew signature:

int BufferNew(Buffer **buffer) -> Buffer* BufferNew(void)

Since BufferNew uses xmalloc internally, checking its return value seems redundant.
Buffer initialization can be done in a single line now. Semantics similar to Map, Set and other data structures.
Merge pull request #337 from awsiv/master

Change BufferNew Signature
Remove dead stuff from ReadPromises

Move SetAuditVersion into ReadPromises
Rename variable ok -> policy_check_ok in generic_agent:ReadPromises
Pull REQUIRE_COMMENTS logic out of generic_agent:VerifyPromises

There's no verification in this.
Fix formatting in CheckConstraint
Remove global BODYPARTS, introduce PolicyCheckRunnable

Previously, referenced bodies from bundles where appended to the global
BODYPARTS list when calling CheckConstraint from the parser. These were
subsequently accounted for in generic_agent:VerifyPromises.

Now, PolicyCheck is split into PolicyCheckPartial and PolicyCheckRunnable.
PolicyCheckPartial verifies a partial policy, while PolicyCheckRunnable
verifies the integrity of a runnable policy. The latter now checks for
undefined bodies from the policy DOM alone.
Remove global SUBBUNDLES, use PolicyCheckRunnable
Merge pull request #338 from sigurdteigen/cleanup/runnable-policy-checks

Cleanup/runnable policy checks
Merge pull request #334 from estenberg/bugfix/lsdir-report

Unsilent error when lsdir() is not able to read the directory
Define failsafe_fallback class on main policy error, useful for special handling in failsafe.cf and reporting
Remove global REQUIRE_COMMENTS, use PolicyCheckRunnable
Remove unused variable freport_html in OpenCompilationReportFiles
Add explicit check for body common control to PolicyCheckRunnable