Memory Retrieval and Consolidation in Large Language Models through Function Tokens