add support for default values (resolves #4, resolves #6)