Initial version of artifact definition validator.

@destijl for code review.

CL is ready for review but please do not merge with upstream, just yet.
Changed the docstring a bit.

I was initially considering to raise, but thought ignoring it might be more tolerant. If you feel strongly about the raise I can add an exception here.