Added methods to the library model to search for entities that match
a given filter and to retrieve entities related to others.
Also added the SearchFilter, to make the search more independet of its
arguments.