Be const-correct.
Introduce text mode to cf_popen and friends, for Windows support.

Part of issue 1884.
Use quoted path so "C:\Program Files" doesn't cause trouble.

Quoted paths are taken into account by the CommandArg0 function.

Part of issue 1884.
Add usemodule autotest for both Unix and Windows.
Remove unneeded static function (only used once).
Replace usage of inet_ntoa() with getnameinfo()

It's threadsafe and protocol independant.

Also removed a couple of possible silent-truncation bugs.
platform.h: put all system includes on top

Also fix some confusing indentation. And removed "#define __USE_GNU". This is
internal to glibc and should never be used, _GNU_SOURCE should be enough if
properly defined before all includes.
Include assert.h centrally in platform.h.
Added some debug messages and silenced a couple of warnings.
Simplified some braindead logic, added comments.
ScopeDeleteSpecial() is unecessary before ScopeNewSpecial()

...pinpointed by the latest WARN messages.
Fix regression of setting VIPADDRESS to 127.0.0.1

See redmine #3010, now it's set to the first address of non-loopback
interface.
Merge pull request #767 from cduclos/bufferlist

New BufferList
Merge pull request #771 from cduclos/bufferlist

RefCount test fix
Merge pull request #766 from kacfengine/usemodule

Usemodule - fixing issue 1884.
Made file copies and edits preserve extended attributes.

This means that ACLs and security context information will be copied
along with a file if the "preserve" attribute is set and the copy is
local, or if the copy is part of an edit operation. For remote copies,
only Unix mode is preserved. If the preservation is unsuccessful, the
promise will fail.

Solves issue 2728.
Changing lsdir to consistently return an slist

If a directory is passed to lsdir which does not exist, it will return
the mismatched type scalar, as compared to its normal return and the
dictated return type in its function definition entry of slist.  This
causes all evaluation to stop in the event of a missing directory due
to mismatched assignment in a var designated as slist.
Switching to new use of CF_NULL_VALUE as requested.
Merge pull request #776 from werkt/master-lsdir-slist

Changing lsdir to consistently return an slist
Fix global log level being reset in newly created threads.