Implement validate command

This also should be inlined for consistency.