Fix encoding issue on narrative blocks
Fix resource reference encode order
Use better valueset enums for SecurityEvent's values