Use some functions from the ResizeArray module for a more-functional style.
Removed some obsolete methods.