Fix orm_cache tool when metadata cache is disabled.

Fix error from when metadata cache was refactored. Add missing tests.

Refs #5061