Cleanup exception handling after implementing multiple directory retries

Cleanup exception handling after implementing multiple directory retries
Throw a RuntimeException if we fail to retrieve the path after MAX_TRIES (10), first using directory caches, then falling back to authorities.

Tidy:
- Exception propagation
- Unused imports, variables
- Array sizes