Sanitize namespace identifiers

Fixes #35