Caching rules before disambiguation.

Unfortunately the diff also contains windows to linux line termination conversion which makes the diff a bit harder to read.