Fix whitespace

I wanted to create a simple PR with some additional tests, but when I started my work I found out that there is a lot of untidy things with whitespace characters.

So I've fixed all that things and added an xt test to make sure this problem will not appear again.

I've used my module [Test::Whitespaces](https://metacpan.org/module/Test::Whitespaces) and s script `whiter` that is part of that module.

Here is the list of rules that are applied:

 * Each line ends with "\n" (including the last line)
 * For new lines "\n" is used (not "\r\n")
 * There are no ending spaces on the lines
 * 4 spaces are used instead of tabs
 * No empty lines in the end of file