remove BOM and fix inconsistent line endings