Updated the code to use xlsxwriter instead of xlwt

Mostly, this change allows me to use the more recent .xlsx file format.
It also adds functionality and simplifies certain methods to make them
easier to understand and use.