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