Optimization pass

This brings full/final compile times down from days to minutes