Cleaned up some Communication code. Started adding more test cases.