added required fields flag, fixes #16

Added a required flag that checks a field is defined on input before defaults are returned.