Update cmd.py to include calculator function

I have added a function that allows the cmd to be used as a calculator.
This is not really complete; I have just outlined the basics.
In my opinion, it would be really great if you could add the calculator
function.