Add keep_attrs to reduction methods

fixes #138

This is a much cleaner version of #139.