On the link between conscious function and general intelligence in humans and machines