added check to passed in options for definedness of each option

This makes it easier to programmatically generate the options supplied, allowing for a simpler "reset to default" by setting the option passed in to undefined, thus invoking the default.
Merge pull request #5 from tianon/patch-1

added check to passed in options for definedness of each option