Forward and small-x physics at CMS