Updates JS to accommodate both Gutenberg and the Classic editor. Also introduces unit tests and conforms to coding standards.
Fixes #2 (closed) Fixes #3 (closed)