Cleaned up example
Added support for streams and traditional callbacks.