Create a separate set of commands to be executed in document context
Bug fixed with file history for file outside of the solution. Closes 2349