A diquark model for pentaquark baryons and tetraquark mesons