Changes to work alongside Swift.

Changed a couple C++ bits to straight C so that this code can be used
in a Swift project:
+ Changed `cells` to a C array.
+ Used `free(cells)` instead of `delete cells`.