Refactoring CLI to simplify and integrate with Spark model better

NOT READY FOR MERGE
I don't know what the official indent policy was, but I changed it because in this particular case, it looks a lot more clear.