refactor(bp): split up into CJS modules and use DI