clean up the code for the main scrolling function
implement re-rereferencing
do not use implitic comparison for None when it's a default value, but always test X is not None, see PEP8 as well
small fix to previous commit
when ref_chan is empty, Select correctly returns an empty array, but when you take the mean, it returns NaN, while conceptually nothing should change