Put ColourTransistionRule and ColourReplacementRule classes into a compilable state.
Resolved merge conflicts. Added some utility functions to strutil.