Fix a few cppcheck warnings.
Make BOM arrays constants to consntant CHARs, since they're only used
to read from them when writing to files, and should keep unmodified.
Split external viewers code.