Add newline normalization for file opening

This patch enables lilypad to open the file
that is UNIX newline (LF) or old Mac newline (CR).