Moved shredding into its own class and added tests