Update bitrpc.py

Tried to make it more readable, but the fundamental changes are the same.