James, it helps a lot, thank you. So much so that I packaged your code and created a plugin out of it so that people can use it more easily. It is available from GitHub here. (Tried to submit it to wordpress.org’s plugin directory but was told they do not take any framework plugins anymore.)
Thanks again!