Cleanup Linker / Optimizer

Consider also asserting that `!tree.static`, just like you do when checking static methods.