Fix the console cli

Seems so often to get left behind.

The use of a case with various checks seems to be fragile and break (it is currently broken in 2.4) - so rewritten to not be one method with a huge case statement in it. 

I'm not sure if keeping this shell is a good idea, perhaps it should be deprecated - if not it needs a unit test and to be keep up to date.