get_HEAD_SHA1 function
Validation tweaks and test

Still no substantive validation being performed,
but we at least have some tests so that we'll
detect any syntax errors that we introduce.