Add line ending test for empty files
Fix newline checking for empty files
Generalize indent_finder more