Move documentation and NAMESPACE to roxygen. Used Rd2roxygen to automate most of the conversion.
Rewrite C++ to use std::vectors.

These replace raw pointers and arrays, which fixes a number of delete vs. delete [] issues. All temporary objects and return values now have value semantics, which makes memory management far clearer and simpler. Also switching to automated formatting with clang-format -i --style=google.
Update version, date, and license specification.