Merge code from whateversh (and some other things)

This merges most of the code from [whateversh](http://github.com/dgelessus/whateversh). In a few cases I simply overwrote the existing commands, because the corresponding whateversh version had more functionality.

Also changed all commands so they will no longer run immediately when imported for some reason, by moving the main command code into a `main` function and adding an `if __name__ == "__main__"`. THere are also various other minor code changes/fixes/simplifications that should not affect the end user (significantly).
I am not sure how useful it is to have all `sys.path` list in `BIN_PATH`. It could be too overwhelming to regular users. It also seems to have a performance hit on my iPhone 4s ...