Replace spaces with underscores in str2cat

str2cat converts a string into a category, so it should
also deal with underscores.

- Use string replacement to add undescores
- Add test case