This adds the general machinery required, and sets it up for the file `typing_status.js` as a first use case. Co-authored-by: Anders Kaseorg <anders@zulipchat.com>