Many improvements to custom loop function, and retitled to indicate it's a getter, not an echoer.