Added python method calls for each command

Also moved the functionality of each command into it's own method.