Move prototype methods outside of function definition (fixing my stupidity causing extreme resource usage).