remove rule imports

It's not clear how rule imports should work on local modules, especially
with a unified imports tree that should get cleaned up. Remove them for
now unless we find a clear use case for this feature.
return resolved imports as a tuple, to preserve their ordering
put structured data on GitError
use update-ref instead of writing to HEAD
factor out Cache._save_tree_to_branch()
initial version of _unify_tree()