Took a stab at format on save functionality

This may work for formatting on save, which would be a nice feature to have.