Connection: rework authentication and registration
Only create messages etc immediately before they are needed, makes
the logic more local. The "preloading" of the hello message didn't
require as much manipulation of internal state as this solution,
but made for a stranger state to keep track of for a longer time
in case something went wrong.