mod_base: more robust, recursive, version of stringify. Assumes input is utf-8.