Streaming library rewrite and other various improvements