strip out characters invalid for resource names, closes #37