Add basic type inference for getitem
Factor out common code for magic methods
Factor out common code for checking args