Moving static functions to functions.php

- Removing the static fromString() method.
- Optimizing reading a string to memory and copying streams.
- Optimizing the creation of streams from disparate types.