[sgen] Move some cardtable functions to sgen