This reverts some of the changes in commit b171cacf4f because now it isn't necessary to pass the loopmgr around.
b171cacf4f