Reduced complexity and added tests for turtle serialization