Move lru_cache to monty where it belongs. Refactor usage in pymatgen.