Strip unnded whitespaces, fixing line endings to UNIX style, catalog SQL optimisations.

Earliest commit strips unneded whitespaces (that are on empty lines and at the end of lines) and fix line endings to UNIX style (\n instead of \r\n). This will shrink tarball sizes and get code a nicer look ;)
Touches only '*.php', '*.css', '*.js', '*.tpl', '*.xml' files. Maybe it is still some extensions missed ;)

Latest commit originally authored by @toporchillo, but due to the fact, that he used bad email — I added it as my own with a thanking to him.