Refactor heartbeat to delegate to the modulestores and sql

LMS-2801

Refactored scalable heartbeat which still does something useful and is equivalent in functionality as far as xml backed courses are concerned but doesn't return the course ids.

@ormsbee @nedbat @e0d first 2 to review win.
If heartbeat is defined as returning a dictionary of service name mapped to some indicator  which may or may not provide information, then the recursion above must receive dicts. When I tried the form you have above, it said `ValueError: dictionary update sequence element #0 has length 1; 2 is required`