Added additional file creation tests.
Added write_formula() and tests.