[tr] fix cmd_tr, use new API, fix "decode hex <nospacestring>", code cleanup