index: Add a \n suffix to all writes

I broke this in #8.. sorry :/
Merge pull request #9 from stephenmathieson/fix/missing-newlines

index: Add a \n suffix to all writes