Implement validate command2

Supersedes #166