Okay I'm nearly certain this is how it went down in the void century.
A boy named Davy Jones, tired of being tied down to his island, went to the sea and became the first pirate. His nickname was Joy Boy, just like Luffy is Strawhat, Shanks is Red Hair etc.
Other people join his crew like;
- Monkey RandomName1
- Gol RandomName2
- Portgas RandomName3
etc.
When Joy Boy was finally was killed, all the members of the crew took on the D initial as support to their former captain, his kids did the same.
Nefertari Lily wasn't on the ship, but she considered herself part of the crew (Just like Vivi with the Strawhats). That's why she signed the letter with the D in her name. When Imu heard that from Cobra it confirmed his suspicion that she betrayed him.
So the D stands for Davy, and it's the Will of Davy.
Luffy is seen as Joy Boy because of his fruit, but Teach is his actual decendent. A perfect pair for the final showdown.