Original opt_einsum commit, very rough