Refactor and fix test for splitExtension(s)

I had to add 4 (simple) utility functions to get rid of the explicit usages of reverse, but I do think the end result is easier to understand.