First pass at porting the ArrayList implementation to C.
There are some changes I made along the way that I want to port back to the C++ version.