Added the fromStream method
Cleaned up tests