Adds appendJavascript and prependJavascript functions