Port of walletbackup.sh to Python.

Could these comments be put into a docstring instead? Importing the file will then reveal these comments in `__doc__`.