Merge "Add tests for TransportStats and some refactor" into pi-dev