I got it to work! It's just a proof of concept right now, and I'll clean it up later. The patch does several things that are needed: