Use "croak" when a required attribute is missing

This helps the caller as they now know which part of their code has
failed to provide a required attribute. Fixes #26.