Various fixes and modernizations

The main changes are as follows:
1) Use portable datatypes (e.g. "unsigned int" is not guaranteed to be 32 bits but "uint32_t" is).
2) It is no longer necessary to manually free the data.  In fact "delete" or "destruct" is not called anywhere now.  Memory is freed when objects go out of scope.
3) std::vector is used in place of arrays, and also for "shape" parameters.

Unfortunately, the API is now different (see example1.cpp) and also C++11 is needed.