Leica LEI: improve setId performance

This primarily involves reading the entire .lei file into memory and
only calling list() when absolutely necessary.