Big changes: Now I'm hijacking the entire page and storing the content in a variable so I can modify EVERYTHING before it's output. I use hook_menu_alter to do this. Hopefully this will allow me to fix the bugs I've been seeing