Use path of macro, fix URI format and move script into body tag

Sorry for doing this all in a single pull request, given the size of the macro it didnt seem worth bothering splitting it up.

Not sure why github thinks the whole file has changed, local diff should show you the proper changes.