Add ability to encode a null value. Fix #3

Fixes #3