Added some variable definition unit tests; beefed up type equivalence checking in semanalyze