Path, File APIs

Added some functions to work with file paths, and some classes to enable
iterating over the files in a directory.  These are woefully incomplete
for POSIX targets.

Fixed a bug in string trimming, which caused an exception to be thrown
unconditionally when trimming a zero-length string (there's now a unit
test for this to prevent regression).

Added an include to socket.hpp necessary for polling functions to
compile on POSIX.

Rewrote SmartPointer factory to make it more fail more intuitively with
respect to consuming unmanaged arguments.  Now if it throws an
exception, it's guaranteed not to have constructed the
object-in-question, which means that unmanaged resources which were to
be wrapped and managed by the object being created are guaranteed not to
have been destroyed by that object's destructor if the factory throws.

Also added a function to SmartPointer so that the internal reference
count may be examined.  This is mostly for debugging.