Tidied this plugin to be more readable.

  The function now works for any input-page, rather than being
 hard-wired to use the index.tmplr page.