Origins of intentional and referential communication