Changes after review.

Improve visualizer performance by inlining functions that the optimizer does not seem to do itself.