c++11 backend: refactoring to use go style channel api.