Add simple JSON serialization and DEBUG macro.