Improve handling of class types and __init__

Most importantly, this fixes #74.  There is also some improved type checking and printing of class types.