Fixed broken get_connected_pieces() function resulting in the planning tests passing properly. Added other tests to validate the internal functions.