fix dircache entry reading, sort per git spec

actually calc num of trailing nulls for entries instead of just trying to
find last null, which can't work. Also sort entries as per git spec as this
is now tested - tests for now in client app not here in the lib. Finally update
to latest prod ver of underscore to fix prob with using it with requirejs from
within qunit tests (in client app).
fix checkout for SHAs (detached Heads)