Added docs for all classes

Also better handle the comparison of two where strings even if the order
of parts are reversed.