Adding support for anonymous classes

I kept the bulk of the tests but rewrote the rest.