Complexity and the function of mind in nature: Externalism and internalism