improve attrgetter, add tests