Made the implementation a a bit more OS agnostic.

Tests pass again, name lookup is downcased, file list is sorted.