Definitions of what everything does
Added some data types, fixed typechecking and imports