[WIP] Add vcsinfo segments

TODO: optimize speed

Closes #734
Closes #658
Fixes #966
Fixes #1098