reduce trust in char frequency analysis

This could lead to cases where utf-8 has less probability than some
weird encodings

I also did some massive whitespace fixes and converted line endings