Optimize ESI fragments, using Array.map and getting rid of the cruft