Fast Algorithms and Efficient Statistics: Density Estimation in Large Astronomical Datasets