Initial version of artifact definition validator.

@destijl for code review.

CL is ready for review but please do not merge with upstream, just yet.
will also want a readfromdirectory method, but doesn't have to be done now.