Added support for Option to Macros

The encode and decode macros now support the Option type.

This closes #144.
put duplicated optional definition into shared module?