General improvements

Fixed memory leak on huge css files, some refactoring, nullbytes fix
(http://www.php.net/manual/en/security.filesystem.nullbytes.php)