Index: add failing tests for a standalone Index

The index can exist purely as a data structure. Let's test that so we
make sure we support that.
Index: make the file optional

There is no obligation for an index to exist as a file at all.
Index: accept a tree for read_tree()

An index may not have an associated repository, so giving it an id in
that case is useless. Raise an error in that case and accept a Tree
object to make the function useful then.