adds flatten to lists, also docstrings
timeperiods work a little more intuitively now
adds tests for the dates module
corrects bugs revealed by tests