Refactor the editor.js into functions

We can migrate these functions out into a separate object a la wpLinks at some point if we want