fix scheduled reports when there is no minute set

mid-sized refactor + tests included

http://manage.dimagi.com/default.asp?133813