Cleans up whitespace

While reading through the code I noticed that the whitespace usage is a bit inconsistent: indentation keeps switching between tabs and spaces, there's a lot of trailing whitespace and not all of the files have a newline at the end of the file. This commit will fix all the whitespace usage to match the Ruby Style Guide which is mentioned in your readme.

The commit became quite a bit larger than expected and I understand this is a bit too much to test. Feel free to just close this without merging, it does show however that the code does not quite match with the style guide.