Secular and tidal evolution of circumbinary systems