Move read/write[bwl] from smp.c to util.h.