Add accessors and tests for _optional/_mandatory.