Refactored module cache loading into a thread.