fix scheduled reports when there is no minute set

mid-sized refactor + tests included

http://manage.dimagi.com/default.asp?133813
this is one bug fix