You'll probably want to start with the GNU Social source code and also take a look at mastodon to see how they hook into GNU Social.
As for decentralizing, my thought would be that it should have been a developed around that from the start. I'm not an expert in it but I think that projects would be built around the decentralized idea and not later modified to be decentralized.