As Al said, the Generico plugin is good for this sort of thing. It can package up JS/CSS/HTML into a self contained template/widget.
I went through and made a template for the abacus. It is attached to this post.
In a Moodle forum it looks like this:
See more about Generico here: https://moodle.org/plugins/filter_generico
See about using template bundles here: https://support.poodll.com/solution/articles/19000086450-how-to-use-generico-bundles