Added a script to attach submodules to d.o remotes and branches for git_deploy.

For git_deploy to work, the current HEAD needs to be associated with a branch name.

If we have a custom fork of the module, then the d.o branches may not be available
for inspection and finding the last merge-parent, so add d.o as a remote.

Once we have the remote in place, make sure that the submodule is on a branch
rather than a detached head. This script tries to find the best branch-name that
includes the HEAD commit.