use refs for checkouts

keep using a branchname option for backwards compatibility
support detached HEAD checkouts
basic dircache file read working

only the fields useful for in-browser FS support implemented.
extensions not yet supported and format hardcode for v2 only
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)
bugfixes for checkouts of deteched heads
add Errornames is prep for switching from codes

the code property in FileError is deprecated, need to switch to just
using the name property instead and will use this map instead of hard
coding strings everywhere.
adding entries to dircache
fixes to get dircache file writing working
fix adding submodule entries to dircache on checkout
refactor to use dircache for dirty workdir checks

now using the dircache to check for dirty workdir prior to doing a checkout.
aldo now support doing a checkout without doing the check to implement
support for "git reset --hard"., though for now that is implemented in lib
client instead of here. also the check returns the modified/new files in
the workdir to allow it to actual be used to implement "git status" soon.
refactor dircache module api to return obj

hide the usage of 'new' inside the module instead of clients having
to call the constructor directly
make sure we *never* write a sha with 'ref:' prefix

as this breaks CGit to point of it not recognising the .git dir
as being a valid repo!
fix to find all modified files, not just first one
quiet down debug logging
start on clean cmd
placeholder for gitignore file support