Provide JSON conversion for common types.

Relates #48.
Add string escaping algorithms.

These algorithms do byte-escaping and escaping according to the JSON standard.

Relates #48.
Make events convertible to JSON.

All data types and values now have conversion functions for JSON.

Relates #48.