Updated with latest code from immutable-history original github repo. The code there is different from that in npmjs