Refactor __init__ to use a Flask subclass; add /heartbeat/