Allow some special characters in filenames

The following special characters are allowed again: ~!@`#$%&=+{}[]
Rationale: They can appear even on Windows (which seems to be the most restrictive OS as far as invalid characters go) and I was overprotective about removing them.
Minor cleanup