Split in main and test folders and completed typechecker