Fix long form JSON parsing for custom commands.

Adds tests and assertions on the args passed into custom commands.