Refactor XML serialization
Refactor JSON serialization
Fix naming, add tests
Update README