Make identifier rules easier to check with a regular expression

The explicit exclusion of . and .. is hard to check, instead just
require an identifier to be at least 3 characters long. This also
prohibits . and .. as valid identifiers and is easier to check for.
Also forbid the identifier to start with a dot which would result
in hidden directories.