sw*(): clean processing of 1st arg

This drops line count by 30%. That, and the isolation of processing to
a single routine at the start of the file should make the code more
extensible and robust.

I do wish that R had a preprocessor, so a lot of the code is still
repeated across the functions (e.g. checking that lengths of
temperature and salinity are the same). Now, that could be done within
lookWithin(), but then the error message would not come from the
user-called routine, which is a bit unhelpful.