move asynchronous JS snippet to <head>