refactor of comms code, added tests for it and changed mechanisem to allow for large transfer