Change sendCommand by invoke and allow a map of params

Change-Id: I23df5bf75c2b6816f80b9a6bafee6a04e07834cf