The folding and evolution of multidomain proteins