Added .asStream functionality.
Tidied.
Added rest support.