Refactoring

In preparation for some File Stream work on upload, a new factory for creating
file streams was made in order to make mocking easier (also means no need for
file writing to system all the time in Unit Tests).