massive update() optimizations and prototype data saving

also added a debug file for us to put any kind of testing code into;
that way we can remove it all at once, easily