Add preamble tests

I added a couple more tests for the preamble stuff.

 - Check the no edit detection code works
 - Check the original file is untouched when not edited

This actually threw up another bug (In my view, Ruby's split function violates the principal of least astonishment by throwing away any empty strings at the end of an array) - files with a trailing new line would have the new line removed. This is also fixed.