some things slightly cleaner, and fixed cross-origin issues with markdown editor