Formats commands.py to use PEP8

Uses 4 spaces for indentation
Uses isinstance instead of type(x) ==
Uses is instead of ==