Do not allow keys which contain spaces or colons

The parser does not accept keys which have spaces or colons, so dumping them
should not be possible. For keys with those characters in them, ValueError
is raised.