refactor rename: TypeChecker.check_type -> TypeChecker.check_subtype
added some typechecking
added some more typechecking and type inference in set_proxy