Kde weights 1103 823

rebased and corrected version of @Padarns PR #1103

needed to normalize weights to sum to 1 for test to pass with `evaluate`
fixed unittests to test `evaluate`

I'm still looking into #1239 to see whether it should be added to this PR.