Adds write to file capability

Adds the capability to write to a file, needs to be tested once I have the cube

Author: lhunker