Initial refactor to use channels to share memory instead of mutex.