Remove an unnecessary check from isValidNameExpression

The check for multiple consecutive .. in tag names is done in parse_tag
Add static to lambdas that are re-used in functions