Consolidate methods in filter file.

Made the generation of the CSM structure and the filtering of a time
series given a CSM their own methods.