Separate validation and extraction of command

Create method ValidateCommand and move the functionality regarding
command validation from ExtractMineFromString to ValidateCommand