codegen: make rest work for strings; add test