The generalized likelihood decoder: random coding and expurgated bounds