Improve output filters.

Fix filters that could lead to filtered HTML output.
Do not remove empty lines anymore, except for the last line.
Do not try to loop over each line of the output if no filter are
defined.