Add basic serialization support

- Adds `serializable_hash` and `as_json` to records
- Adds a `readonly` option to `Record#attribute`