Library view search: add back expansion in search

Functions to expand and isExpanded can operate on other arrays other than the ivar.