Add support for generating nodeids, move some CLI flags around.