Update tags.
Add string function to test if it is a valid identifier.
Fix tag output.
Add PARENT tag if there is only one parent to save space.