Make assocIn return obj as convenience
Allow refs.write() to write HEAD
Make writeFilesFromTree check for existence before creating dirs
Add files.deleteEmptyDirs()
Pull writeCheckout add, modify del into own fn
Set HEAD to new ref when checking out
Delete empty dirs after checking out
Pass ref to writeCheckout

* So can set HEAD correctly
cd to repo root before checking out
Test checkout adds new files in checked out ref