Remove redunancies from sofa.c

This is a little unnecessary, but the monolithic sofa.c was hard to read due to *every single function* containing the SOFA license.  This strips it down to just one copy of the license at the end of the file, and also moves all the includes to the top.  Saves a fair bit of space.

If desired I could also upload the script for this, but it's just a handful of regular expressions.