As you can see I have done some compositing in the main window and when I click render none of the compositing I have done is outputting.
Compositing is a form of what is known as post processing. As the name implies, post processing is something that is done after the image is rendered. The way Blender works, first your image is rendered, then the rendered image is sent through the compositor. So you won't be able to see your compositing applied until Cycles is finished rendering the image.
Cycles tells you what is going on at the top of the render window, in your screenshot it says "Path Tracing" (which means rendering), when it finishes rendering it will start applying your compositing nodes and will say "Compositing" at the top.
Once the entire rendering process is completed (including the compositing), you can change what is displayed with the dropdown menu at the bottom of the UV/Image Editor.