Rename function arguments to an CommandFunction and FlagFunction
Add arity checks
Refactor distributing the code in 3 files
Fix double executing callFlags