(CFACT-94) fix processor facts for solaris

Before this patch, there was an inconsistency between facter 2.2 and cfacter in
the count reported, with the count equal to the number of hardware threads
in facter, and equal to the number of cores in cfacter.

This fixes cfacter such that it is similar to facter 2.2
(CFACT 86) Fix network address

Previously, the networking resolver did not resolve the network address
correctly. This patch gets the network address from the ipaddress and the
netmask correctly.
(MAINT) ensure that reinterpret cast is used instead of c-style cast.
(CFACT 86) Ensure that we do not modify req on ioctl

Previously, ioctl modifed the request structures when it was passed it
in. This patch ensures that ioctl operates on a copy rather than the original.
(CFACT-121) Implement dynamic loading of the ruby dll on Windows

Adds defines for Windows _access and _waccess calls, to make them similar to Linux.
Adds a scoped_error class for Windows system error messages.
Adds execution::which, implemented identically to Facter's method.
Simplifies POSIX api::find_library with use of tie for comparison and assignment.
Implements Windows api::find_library, dynamic_library::load, and dynamic_library::find_symbol to facilitate loading the Ruby dll.
Add --trace option for low-level logging that's rarely useful for debugging and clutters the output.
(CFACT-121) Implement find_by_pattern and minor fixes

Implemented find_by_pattern, which searches loaded DLLs for one that matches the
specified pattern and returns a handle to it in the form of a dynamic_library.
Fixed const and & correctness of helper functions.
Changed Ruby library version comparisons to use int instead of string.
Check that a sub_match is valid before using lexical_cast in regex.hpp, so optional
matches don't throw an exception.
Merge pull request #137 from MikaelSmith/task/master/CFACT-121-implement-ruby-facts-on-Windows

(CFACT-121) Implement dynamic loading of the ruby dll on Windows
Merge pull request #146 from vrthra/fix/cfact-86/solaris-networking

(CFACT-86) Solaris: fix network address
(CFACT-91) Add Windows external fact

Add external fact support and execution infrastructure.
New to Windows are batch files and Powershell scripts.
Implement get_external_fact_directories and can_resolve on Windows.
Add scoped_env class for modifying and restoring the environment, useful on Windows because it's easier than directly modifying the child environment in some cases.
Split module::execute_command into Windows and Linux variants to handle shell execution.
Fix failing unit tests on Windows, enable unit tests in AppVeyor.
Add ruby in AppVeyor for unit tests.
Add execution unit tests.
Fix util::each_line for Windows line endings.
(CFACT-91) Enable logging and environment testing on Windows

Add unit testing related to execution and update environment::get, which didn't work on Windows for variables modified in the same process.
(CFACT-91) Add powershell resolver and unit test
(CFACT-91) Add unit test for scoped_env and environment::clear
(CFACT-91) Add test asserting Powershell architecture matches compilation

We want to use 64-bit Powershell on 64-bit Windows. The Powershell used is determined by the architecture of the process
executing it, by hidden Windows redirection. This test confirms that 64-bit Powershell is used for a 64-bit compiled
facter, and 32-bit Powershell is used otherwise. This should cover most desired cases of providing 64-bit Powershell
to users.
(CFACT-91) Restructure execution tests

Combine common tests (yaml, json, txt) in collections.cc, and add external facts testing for powershell.
(CFACT-91) Resolve potential dead-lock in reading stdout/stderr

If a child process writes to stderr exceeding the pipe buffer, the child will block on write. If we don't simultaneously
read stderr, ReadFile on stdout can block the thread, leading to a deadlock. Implement a thread for reading from stderr
and writing the results to LOG_DEBUG.
(CFACT-91) Rework execute to share stream-processing code

Execute has a section that processes stream output from ReadFile/read, either calling a callback or concatenating the results.
Extract that code into execution::process_stream so it can be shared between Windows/Linux, accepting a closure that yields
new data from a stream.
(CFACT-91) Clean up interface for process_stream

Use strings in the yield_input closure passed to process_stream for a more consistent interface.
We have to abuse STL strings a little to avoid copies with C-api calls, but this usage is
conformant to C++11 (the buffer is guaranteed contiguous, and resize fixes the string metadata).
(doc) Incorporate er0ck's Windows build feedback
(CFACT-91) Use boost::optional to clarify intentions
(CFACT-128) Switch to *nix-agreed implementation of timezone reporting

Two things to fix here:

1) The daylight variable seems to be non-standard. At least it's not
mentioned here:
http://pubs.opengroup.org/onlinepubs/7908799/xsh/time.h.html
which states "The value of tm_isdst is positive if Daylight Saving Time
is in effect, 0 if Daylight Saving Time is not in effect, and negative
if the information is not available." (I speculate the use of a daylight
extern'd by the C library is an early implementation.)

2) FreeBSD doesn't support tzname: https://wiki.freebsd.org/FreeBSD_and_Standards

Next I turned to gettimeofday, but no love from FreeBSD there either:
http://www.freebsd.org/cgi/man.cgi?query=gettimeofday&sektion=2

Next I looked at boost, which allows trick features like custom timezones but not
(apparently, I may have missed it) simple reporting of current timezone.

Next up was std::time_put, but that's not implemented in gcc 4.8:
http://stackoverflow.com/a/14142342/1004272

So, crossing fingers, but good ol' strftime may do the trick. Yippee.