[FIX] __cmp__ class TaskOccurrence

- Closes #1335
[REF] Moved Peridic related to perodic.py
[FIX] Revert 0c8bfd31 because tests broken
[FIX] Added unit test for TaskOccurrences cmp
[FIX] Python 2.6 compatibility

 * plus PEP8