added date stamp to dreams, moved JSAPI to local file for preloading