Add ruencode and rudecode util functions.
Add missing test coverage.