Galaxy evolution and the AGN connection