Clean up logic related to usertypes in Yang code.

Fix various issues introduced by 915f141ee6264467276613c199e76eadf4010edb
(which mostly removed the distinction between types in expressions in
the grammar, and allowed identifiers as types).