Revised M06 density functional for main-group and transition-metal chemistry