Add VersionName macro

There's a lot that could be fixed and cleaned up here, but I went for minimal change to get it working.

The macro is a trivial swap; the JavaScript was tested on a locally-downloaded page.

@tfoote
That's reasonable. Will change.