SPEEDUP: Implemented weightedMean() in native code; it's ~10 times faster than stats::weighted.mean().