Fixed behaviour on transition from month to month.

- Fully unrolled the former "where the magic happens" block,
  which used to be very very tightly written and fragile,
  and added hopefully more robust walkback through rotated
  sa files.
- Cleaned up indentation as well.
- Zero padding of sa files with single-digit day of month.