added support for OSX and converted to dynamic framework