Use ArrayStack for tracking accumulation in tailrec folding

Improves performance substantially