Cleaned up the code a bit.

This PR simply cleans up the code a bit:

- Renames `editorIsEmpty` to `isBodyEmpty` to make the code more readable.
- Adds some code that should've been in `editorIsEmpty` to it.
- Reduces a duplicate call to `getHTML` to a single one.