Latest version of patch, incorporating regression tests and docs, andfixing the "operator" issue previously raised.
-- Andrew (irc:RhodiumToad)