There's the issue with docking wich is wich name to keep. I think we could have two docking modules, one "dominant". The two docked ships will keep the name of the dominant module. Also, the name of the other ship is stored on the other module, that way when undocking it can recover its name.
Another way to see docking is like locking works today, with no physical merging of the two ships (crews stay independent), but the ship would obey under the same commands (direct control would control both ships, for example). For the game engine, the only thing that happens is both ships are stuck together, but no merge actually happen. Wich could save a lot of programming hassle, IG.
That could probably applied to moving parts too, where they are technically another ship, but obey the same commands (and could share command points)