added requirejs support + safari fix