Remove debugging code and minor optimizations also clarifying the code
somewhat (to me at least). Planning a rewrite of some handler
functions here.
Reimplement scalar graph rebuilding. Code is cleaner and slightly
faster but not by much.
Work on optimizing scalar graph rebuilding.
Save some more memory. Comment a bit better.