Use #tr instead of #gsub where possible

Pick up some speed improvements with tr over gsub