Modular Editor in Javascript