TODO some tests, better API for connecting nodes