Fixup "Move ..." [to add more comments]
Add tests for phase computation and fix a few minor bugs

The bugs were:
- when in a post-contest phase, the start of that phase was computed
  without taking the extra_time into account;
- the starting_time was allowed to be before the start of the contest;
- when starting_time was not None we assumed it to be in the past, i.e.
  starting_time <= timestamp.
These were all conditions that didn't affect a "normal" contest.
Fixup "Add tests ..." [to add more comments, PEP8 and pylint]
Rewrite the phase computation function

Simplify it and support delay_time (reenabling its tests).
Fixup "Rewrite ..."
Fixup "Rewrite ..." [to add more checks]
Add delay_time
Fixup "Add delay_time"