Implement __repr__ hook for various classes

This improves usability when working with instances in a REPL
environment.