Adds support for OS X without X11.

OS X support shouldn't depend on X11 being installed on the host.
Removes the X11 dependency.