Got to a point where I realized this needs to be a module, not a widget. Committing my current state, and starting a branch to work on the module version.