Added ability to use scalar refs for text (to avoid the problem of iterators returning some blessed things and other non-blessed things)