refactor csp.js, util functions (wait, select ...) return channel now.