This is my first attempt at a WordPress plug-in, so it is likely to be flawed. However it seems to work OK.
I am planning a few improvements. Please let me know if you find it useful.
Also if anyone if familiar enough with wp-cache to tell me if it would cache the output of this plug-in I would be grateful for the info.