Implemented Repository.discover
Added Repository.head_is_orphaned and Repository.head_is_detached