stats mode function: minor changes + unit test
Merge remote-tracking branch 'upstream/develop' into develop
stats functions: added percentile and median
Merge pull request #2645 from fabriziofortino/develop

stats: percentile and median impl + minor refactoring to mode