Fixed bug in links from test results web page

Also adding documentation to an increasingly complex section of code.
Merge branch 'master' into gh-pages
Updating gh-pages with latest generated docs