Semiparametric Density Estimation via Basis Functions