unpack now supports 3 or 4 arguments

I might have done this in a really ugly way. I am not sure if I could
have used the argument ellipses to avoid so much code duplication.