Add proper save method

It will remove trailing whitespace and add CR at EOF