Move some data structure functions to separate static module.