Refactor heartbeat to delegate to the modulestores and sql
LMS-2801
Merge pull request #4078 from edx/dhm/heartbeat

Refactor heartbeat to delegate to the modulestores and sql