call to_array for set_field_value
to_array now coverts datetime
added "function_args" to db class to handle passing arguments to db functions