Changes field formatting to be separate function; Adds validation test for field formatting function