Fix bug in output ref renaming

http://manage.dimagi.com/default.asp?147618
`\w` includes `0-9`

Sources:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#special-word
http://stackoverflow.com/questions/2519845/how-to-check-if-string-is-a-valid-xml-element-name#comment23447967_2519941