Added a new Comm class to wrap some communication functions.