Some more cleanups. Should move fini/init h_module into a cntextmanager