Added sorting functionality to the tables.
Fixed an error: when new file loads, the openFile is set to null to
prevent writing over the previously opened file.