Refactored semantic type check

Type check now uses a visitor to determine if the type is a numeric or a
boolean type.
Removed boiler plate code from semantic validator
Removed more boiler plate code from sem. check