Fixed code errors.
Added changing inputEncoding when file is already loaded

DataModel now also stores inputEncoding.