Improve gitmodules file parsing

Gitmodules file can have arbitrary indentation and spaces in various
places in the middle of the lines.