export serialization function from turtle parser and properly hide
internal functions. also added some tests for serialization