finish up implementation of DOCS-992
The initial implementation has a few issues. Worst one being some timing issues breaking 3rd party code, but there is also room for improvement of the current code. At least it seems a little over complicated, so there should be a review.