added tests and converted :javascript to a script block