finish factoring out functionality from main background.js file into backend/ modules.