Add type checker functions.

Addresses #8.
Adds function to check the type of an expression.