Added support for http; Refactored internals to use Classes.