Added support for XML serialization, and fixed a couple JSON bugs