Cleanup buffer before saving

* untabify
* kill trainling whitespace
* make UTF8