First pass at ldafcgs.
Merge branch 'fast_cgs' of https://github.com/inpho/vsm into fast_cgs
Fixed off-by-one bug in computation of I