Improved the mining spreadsheet

All columns can be used to sort the table. If none is used it defaults
to sort by id.
Also the refining gain percentage appears in red when it's a loss.