Simplify JSON encoding/decoding by merging it into Base