Added support for Mac OS X; updated build system to use CMake instead of autotools