Moving libraries from sync JavaScript