Automatically convert - to _ in keys when writing JSON