Added basic serialization functions. Changed file hierarchy.