Better explanation of how the script works

I added more comments up at the top to explain how the script
works.  I also refactored the data flow a little bit so that
all aggregation happens before the feature vectors
and inertial measurements are combined.