Change embedded ugoira script into a function

There doesn't seem to be any benefit to keeping the script embedded (saving the page, etc) so I've changed it over to a function.