Initial version of artifact definition validator.

@destijl for code review.

CL is ready for review but please do not merge with upstream, just yet.
Ack I'll change that, mainly a preference for ValueError, no strong reason.