Read git ref for this session from server response

Also, refactor cache parameter computation.
a little more shell escaping
Version bump to 1.18.0