API: Add methods for JSON conversion.

Adds some API methods which convert objects into JSON literals. There is
a common method `as_json` in `Object` class which is overridden in `Bool`,
`Iterable`, `Map`, `Int`, `Float`, `String` and `Void` which add support
for other JSON literals as well.

The default implementation simply converts the object into JSON object,
with objects attributes as it's keys and values.