Port over the following two commits from core.
commit 8f3e38477e30abd9dd0e24a4d612126117f7793c Merge: 2580ff81f 2a52ae63b Author: Wladimir J. van der Laan <laanwj@gmail.com> Date: Tue May 2 19:10:23 2017 +0200 Merge #10169: [tests] Remove func test code duplication 2a52ae6 Remove duplicate method definitions in NodeConnCB subclasses (John Newbery) 52e15aa Adds helper functions to NodeConnCB (John Newbery) Tree-SHA512: 2d7909eb85b3bde0fc3ebf133798eca21e561f4b2a2880937750820a42856cfb61fc94e30591c14ac13218bcfae0ebe7c5e8662a7b10f5b02470325c44a86cf1