Fixed bitmask colision on OSX.
Created constants for socketoptions instead of raw #s.
Changed cod to allow "" in addition to NULL for name.
Added new socket options.
Added new unit tests and fixed false error hits on OSX due to different
error values.