Replaced JSON based IO to serialization to keep file handling simple. Some improvements