Initial version of artifact definition validator.

@destijl for code review.

CL is ready for review but please do not merge with upstream, just yet.
hrm.  Why not just instantiate each object as normal and catch the formaterrors, group them and print all at once?  That way your validation logic is only in one place.  With this extra code it needs to be maintained here as well, and if they are out of sync objects might pass validation but not get created successfully.