If this helps anybody, I encapsulated some of the ideas in this post into a project:
https://github.com/eswann/ClearScript.Manager
And a Nuget package:
https://www.nuget.org/packages/ClearScript.Manager/
https://github.com/eswann/ClearScript.Manager
And a Nuget package:
https://www.nuget.org/packages/ClearScript.Manager/