Fix cfrequency refactoring

Here is an attempt at refactoring one of the signal.freqattributes routines, as per issue #532. 

It may not be the most elegant way of refactoring the code, but it allows the calculation of the central frequency for a single trace. Tests all passed ok, including new test for the single trace case.