Added documentation and tests for format_name