Fixup weird formatting, uneeded allocs, and duplicate code in rlm_rest