finished lib-ifying the solution to load from URL, local file, or existing stream.