Fix rank filter kernels
Wrap code at 80
Add tests for all rank filters and reformat code
Merge pull request #1244 from ahojnnes/rank-fix

Fix rank filter kernels