Added documentation to shell.py. Also made sure it complied with PEP8.