feat(serialize) Implement serialization to file

fixes #5