Added requirejs support; Safari fix