function writePromise(path, contentToWrite) {
            _write(path, contentToWrite)
                .done(function () {
                    result.resolve();
                })
                .fail(function (err) {
                    result.reject();
                });
        }
Writes content into a json file
@param   {boolean} overwrite  - true if file is to be overwritten, false otherwise
@param   {object} [content=this.state] - content to be written into the json file.
@returns {$.Deferred} - a jquery deferred promise, that is resolved with a write success or failure