Fix some circular dependencies and make the *Prototype references into variables instead of functions.