refactored <unicode> - to reduce backtracking; added <ident> cleanup hackery