Nonparametric hierarchical models based on completely random measures