Cleaned up stream aggregate apis in JavaScript.