Slightly faster and safer implementations of traversal, add, and remove functions to reflect traversal.