Add SWIG output for OS X, rewrite as class