Allow to specify what to sync in sync_all (blocks / mempool).

Also, only sync blocks after joining networks.  mempool tx might not be
broadcasted / synchronised properly, making the join hang.
Add test for reorg / undoing of name operations.