Additional docstrings for many functions; some improvements to logging

I've added docstrings to many of the functions, providing better help information in interactive mode (e.g. in ipython). I've also improved the logging functionality a bit,
particularly in debug mode which is much more verbose now and prints out the actual GET/PUT requests to the log stream.