Correct return type of empty literal collections
Add toUpper and toLower
Use ArrayStack for tracking accumulation in tailrec folding

Improves performance by several orders of magnitude
rewrite: extract parameters from literals