Started working on type checking

Mainly schema inference