Added tests for segments, renamed fixtures, removed code duplication, changed purge invaldiated data task priority