Remove several dependencies and more fixes for OSX compilation