Fixed Bug #1

Introduced new private methods _get_safe_start and _get_safe_end that
are slow, but safe fallback algorithms.

Deprecated buggy _get_start_of_the_day sub.