fix scheduled reports when there is no minute set

mid-sized refactor + tests included

http://manage.dimagi.com/default.asp?133813
Merge pull request #4285 from dimagi/scheduled-reports

fix scheduled reports when there is no minute set