(PUP-1490) Support --test option for puppet apply

This allows more parity between puppet agent and puppet apply and also
makes it easier to enable a bunch of testing options for apply.
Merge pull request #2286 from dalen/apply_test

(PUP-1490) Support --test option for puppet apply
PUP-1494 - Remove Windows iconv from colors.rb

  - We no longer support / ship Ruby 1.8 on Windows, so iconv support
    is not necessary
PUP-1494 Guard against Win32 memory corruption

 - Ruby's .encode(UTF-16LE) call on String may generate a string that
   not properly terminated with 2 NULLs, which may result in garbage
   bytes read from the memory pointer passed into the Win32 API. This
   can cause memory instability which results in failures in later
   Win32 calls.  These calls have been replaced with an internal
   helper that properly NULl terminates the string.  Note that this
   bug is fixed in Ruby 2.1:
   http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?revision=41920&view=revision