cleaned up TableUnload and added tests