Added newInstance to Stack class, to make use cleaner and hide inner-workings of PrimitiveArray/ReferenceArray hierarchy.