Add range checks to tpie::internal_vector.
Replace vector with typedef and correct memory usage reporting.
Use tpie_new and tpie_delete for allocation.
Reduce bufferCount to 2.