Change the way that heading are applied to elements so that they no longer destroy the parent element by replacing the original tag.

Before if someone attempted to add h1 or h2 a `<blockquote>` or `<li>` element, it would wrap the parent element in the selected heading tag. This works fine, until the user attempts to remove the heading, upon which the wrapped element would be replaced with a `<p>` tag, and the `<h1>` tag was left in place.

**To replicate the bug**:
* Select a `<blockquote>` or `<li>` element.
* Click on h1 to add h1 to the selected element.
* Attempt to remove h1 from the selected element.

I've fixed it by adding a `toggleFormatHeading(tag)` function. This function attempts to match the chosen heading `tag` in the selected elements class names. It removes it if it is found, and adds it if it isn't.

I've also added the proper functionality to `reloadMenuState()` to properly check for class names so that the right menu action can be highlighted.