Make getting the command corresponding with a commandset O(n)

Signed-off-by: Ian Macalinao <ianmacalinao@gmail.com>