First part of support for optional types

Added optional val, and encode and decode.

The decode is a bit nasty since for anything that isn't a string we want to decode "" as None. However, for string we decode it as Some("").
`Some.apply[T]: Some[T]` which then gets casted as `Option[T]` when needed.
`Option.apply[T]: Option[T]` is guaranteed to have type `Option[T]`.