Continuing pythonizing

key_string function is added to make it easier to create keys to store
stuff on redis.
key function in "downsample" modified accordingly
sub_avg and step_fnc functions fixed for the new namedtuple structure

moved filename variable to global