Remove newlines
Add shebangs
Tidy up some more