Bugfix and better parsing
Bugfix and better parsing

I incorrectly thought the function writelines appended a newline if it
was not there. Well, now after the junk lines have been read, it is
checked if the last one contains a newline. If not, one is added.

This allows the parser to keep all newlines in the file intact, thereby
truely allowing a user to add and remove templates in the file without
anything they'd previously written to be changed.

Pat-Laugh/gitignore-modifier