Add tests for ToClassDefinition()
Fix string format issues with ToClassDefinition()