Added a 'WriteToFile' function

This is a wrapper around the []byte casting. Not sure if this is the
most idiomatically Golang way to do it (I doubt it, actually), but it
will do for now.