Fixed various errors on scoping and typing.
Added the unit type.
Fixed a wrong location calculus on parsing error.
Added some error pretty printing support.
Added definitions.