Add support for optional arguments

Fixes #12