add support for MACOSX and cache some formulae (#436)