Few minor bug fixes.
Some minor bug fixes and refactoring of some weird things.
Headers labels will now be unique.
Bug fix.
Plugin should no longer cause recursion loop when inserting the same document to itself.
Documentation of the new code, some garbage deleted.