some changes towards simplifying C extension interface (II, not finished yet).