refactor to avoid getElementById lookups

* allow for first argument to be an Element as well as an Id string
make readme interactive