core: wcore_context_{init,teardown} rework