From there everything went wrong. Soon the page wouldn't register any functions. I moved it all to an external .js file and that solved nothing.
So I went back to where it all went wrong. One by one as I used the page I would get an undefined function error. So I moved these one by one to a different part of the page. Soon I was able to get all the code working but I had my leftover <script> tags.
So I deleted this and lo and behold, the page stopped working completely again. So I put it back in and it worked!
But it's one of those "how the hell did I ever figure that out."
In case someone is bored and wants to figure this out I've attached the code. I wouldn't mind knowing (for future reference) why in the world this is happening.