Add option to disable BOM.
Replace Qt algorithms with STL algorithms.
Share code for checking if filename is rich text.
Rename codepage to encoding.
Update ifdefs for Qt 5.